Skip to content

Commit

Permalink
Update NXfield.__array_wrap__() arguments
Browse files Browse the repository at this point in the history
For NumPy 2.0 compatibility.
  • Loading branch information
Z2h-A6n committed Jun 21, 2024
1 parent db0fc0b commit d75e614
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nexusformat/nexus/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -3280,7 +3280,7 @@ def __array__(self, *args, **kwargs):
"""Cast the NXfield as a NumPy array."""
return np.asarray(self.nxdata, *args, **kwargs)

def __array_wrap__(self, value, context=None):
def __array_wrap__(self, value, context=None, return_scalar=False):
"""Transform the array resulting from a ufunc to an NXfield."""
return NXfield(value, name=self.nxname)

Expand Down

0 comments on commit d75e614

Please sign in to comment.