Skip to content

Commit 484e07a

Browse files
committed
[WIP] Making center grid serializable
1 parent 35215c6 commit 484e07a

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

gempy_engine/core/data/centered_grid.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
from dataclasses import dataclass
2-
from typing import Sequence, Union
1+
from dataclasses import dataclass, field
2+
from typing import Sequence, Union, Annotated
33

44
import numpy as np
55

6-
from gempy_engine.core.backend_tensor import BackendTensor
7-
from gempy_engine.core.utils import cast_type_inplace
8-
96

107
@dataclass
118
class CenteredGrid:
129
centers: np.ndarray #: This is just used to calculate xyz to interpolate. Tz is independent
13-
resolution: Sequence[float]
14-
radius: Union[float, Sequence[float]]
10+
resolution: Sequence[float] | np.ndarray
11+
radius: float | Sequence[float] | np.ndarray
1512

16-
kernel_grid_centers: np.ndarray = None
17-
left_voxel_edges: np.ndarray = None
18-
right_voxel_edges: np.ndarray = None
13+
kernel_grid_centers: np.ndarray = field(init=False)
14+
left_voxel_edges: np.ndarray = field(init=False)
15+
right_voxel_edges: np.ndarray = field(init=False)
1916

2017
def __len__(self):
2118
return self.centers.shape[0] * self.kernel_grid_centers.shape[0]

0 commit comments

Comments
 (0)