Skip to content

Commit

Permalink
adding copy keyword just __array__ signature
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrolexa committed Oct 21, 2024
1 parent 7576b12 commit 76bc6f1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/apsg/feature/_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def label(self):
"""Return label"""
return self.name

def __array__(self, dtype=None):
def __array__(self, dtype=None, copy=None):
return np.array([np.array(p) for p in self.data], dtype=dtype)

def __eq__(self, other):
Expand Down Expand Up @@ -902,7 +902,7 @@ class PairSet(FeatureSet):
def __repr__(self):
return f"P({len(self)}) {self.name}"

def __array__(self, dtype=None):
def __array__(self, dtype=None, copy=None):
return np.array([np.array(p) for p in self.data], dtype=dtype)

@property
Expand Down
6 changes: 3 additions & 3 deletions src/apsg/feature/_geodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def __ne__(self, other):
"""
return not self == other

def __array__(self, dtype=None):
def __array__(self, dtype=None, copy=None):
return np.hstack((self.fvec, self.lvec)).astype(dtype)

def label(self):
Expand Down Expand Up @@ -485,7 +485,7 @@ def __ne__(self, other):
"""
return not self == other

def __array__(self, dtype=None):
def __array__(self, dtype=None, copy=None):
return np.hstack((self.fvec, self.lvec, self.sense)).astype(dtype)

def to_json(self):
Expand Down Expand Up @@ -649,7 +649,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not self == other

def __array__(self, dtype=None):
def __array__(self, dtype=None, copy=None):
return np.hstack((self.axis, self.secant, self.revangle)).astype(dtype)

def label(self):
Expand Down
2 changes: 1 addition & 1 deletion src/apsg/math/_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __copy__(self):
def __hash__(self):
return hash((type(self).__name__,) + self._coords)

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

def to_json(self):
Expand Down
2 changes: 1 addition & 1 deletion src/apsg/pandas/_pandas_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def dtype(self):
"""
return Vec3Dtype()

def __array__(self, dtype=str):
def __array__(self, dtype=str, copy=None):
return np.array([str(f) for f in self._obj], dtype=dtype)

@classmethod
Expand Down

0 comments on commit 76bc6f1

Please sign in to comment.