Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
8 changes: 4 additions & 4 deletions galleries/examples/units/basic_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ def __getattribute__(self, name):
return getattr(variable, name)
return object.__getattribute__(self, name)

def __array__(self, dtype=object):
def __array__(self, dtype=object, copy=False):
return np.asarray(self.value, dtype)

def __array_wrap__(self, array, context):
def __array_wrap__(self, array, context=None, return_scalar=False):
return TaggedValue(array, self.unit)

def __repr__(self):
Expand Down Expand Up @@ -222,10 +222,10 @@ def __mul__(self, rhs):
def __rmul__(self, lhs):
return self*lhs

def __array_wrap__(self, array, context):
def __array_wrap__(self, array, context=None, return_scalar=False):
return TaggedValue(array, self)

def __array__(self, t=None, context=None):
def __array__(self, t=None, context=None, copy=False):
ret = np.array(1)
if t is not None:
return ret.astype(t)
Expand Down