Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2c7e4ef

Browse files
committedMay 23, 2025·
[BUG] Fix cached_pivot setter to handle input as list.
Updated the `cached_pivot` setter to accept lists and convert them to NumPy arrays, ensuring compatibility and preventing potential runtime errors.
1 parent a264129 commit 2c7e4ef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎gempy_engine/core/data/transforms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Transform:
2828
scale: Annotated[np.ndarray, numpy_array_short_validator]
2929

3030
_is_default_transform: bool = False
31-
_cached_pivot: Optional[np.ndarray] = None
31+
_cached_pivot: Annotated[np.ndarray, numpy_array_short_validator] | None = None
3232

3333
def __repr__(self):
3434
return pprint.pformat(self.__dict__)
@@ -76,8 +76,8 @@ def cached_pivot(self):
7676
return self._cached_pivot
7777

7878
@cached_pivot.setter
79-
def cached_pivot(self, pivot: np.ndarray):
80-
self._cached_pivot = pivot
79+
def cached_pivot(self, pivot: list):
80+
self._cached_pivot = np.array(pivot)
8181

8282
@classmethod
8383
def from_input_points(cls, surface_points: 'gempy.data.SurfacePointsTable', orientations: 'gempy.data.OrientationsTable') -> 'Transform':

0 commit comments

Comments
 (0)
Please sign in to comment.