Skip to content

Commit

Permalink
Merge branch 'array_interface'
Browse files Browse the repository at this point in the history
  • Loading branch information
tskisner committed Oct 25, 2022
2 parents ef01d9d + 3e83e70 commit 5c434b3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pshmem/shmem.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,14 @@ def __iter__(self):
else:
return iter(self.data)

def __array__(self):
def __array__(self, *args, **kwargs):
"""Provide the underlying numpy data view as the array."""
return self.data.__array__(*args, **kwargs)

@property
def __array_interface__(self):
"""Provide the underlying numpy data view as the array interface."""
return self.data
return self.data.__array_interface__

def __repr__(self):
val = "<MPIShared"
Expand Down

0 comments on commit 5c434b3

Please sign in to comment.