Skip to content

Commit b32fa7c

Browse files
committed
[BUG] Patching RegularGrid for python 3.12+
1 parent 86324db commit b32fa7c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gempy/core/data/grid_modules/regular_grid.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class RegularGrid:
1616
Class with the methods and properties to manage 3D regular grids where the model will be interpolated.
1717
1818
"""
19-
resolution: Annotated[np.ndarray, numpy_array_short_validator] = np.ones((0, 3), dtype='int64')
20-
extent: Annotated[np.ndarray, numpy_array_short_validator] = np.zeros(6, dtype='float64') #: this is the ORTHOGONAL extent. If the grid is rotated, the extent will be different
21-
values: Annotated[np.ndarray, Field(exclude=True)] = np.zeros((0, 3))
22-
mask_topo: Annotated[np.ndarray, Field(exclude=True)] = np.zeros((0, 3), dtype=bool)
19+
resolution: Annotated[np.ndarray, numpy_array_short_validator] = dataclasses.field(default_factory=lambda: np.ones((0, 3), dtype='int64'))
20+
extent: Annotated[np.ndarray, numpy_array_short_validator] = dataclasses.field(default_factory=lambda: np.zeros(6, dtype='float64')) #: this is the ORTHOGONAL extent. If the grid is rotated, the extent will be different
21+
values: Annotated[np.ndarray, Field(exclude=True)] = dataclasses.field(default_factory=lambda: np.zeros((0, 3)))
22+
mask_topo: Annotated[np.ndarray, Field(exclude=True)] = dataclasses.field(default_factory=lambda: np.zeros((0, 3), dtype=bool))
2323
_transform: Transform | None = None #: If a transform exists, it will be applied to the grid
2424

2525
def __init__(self, extent: np.ndarray, resolution: np.ndarray, transform: Optional[Transform] = None):

0 commit comments

Comments
 (0)