Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions imas/ids_primitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ class IDSNumeric0D(IDSPrimitive):
__doc__ = IDSDoc(__doc__)
__slots__ = ()

def __array__(self, dtype=None):
def __array__(self, dtype=None, copy=None):
return np.array(self.value, dtype=dtype)

def __str__(self):
Expand Down Expand Up @@ -437,7 +437,9 @@ class IDSNumericArray(IDSPrimitive, np.lib.mixins.NDArrayOperatorsMixin):
# list, to support operations like np.add(array_like, list)
_HANDLED_TYPES = (np.ndarray, Number)

def __array__(self, dtype=None):
def __array__(self, dtype=None, copy=None):
if copy:
return self.value.astype(dtype, copy=True)
return self.value.astype(dtype, copy=False)

def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
Expand Down