Skip to content

Commit 5c434b3

Browse files
committed
Merge branch 'array_interface'
2 parents ef01d9d + 3e83e70 commit 5c434b3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pshmem/shmem.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,14 @@ def __iter__(self):
332332
else:
333333
return iter(self.data)
334334

335-
def __array__(self):
335+
def __array__(self, *args, **kwargs):
336+
"""Provide the underlying numpy data view as the array."""
337+
return self.data.__array__(*args, **kwargs)
338+
339+
@property
340+
def __array_interface__(self):
336341
"""Provide the underlying numpy data view as the array interface."""
337-
return self.data
342+
return self.data.__array_interface__
338343

339344
def __repr__(self):
340345
val = "<MPIShared"

0 commit comments

Comments
 (0)