Skip to content

Commit ba227b4

Browse files
committed
[ENH] Refactor GeophysicsInput with type annotations
Replaced raw tensor attributes with `Annotated` numpy arrays for better type validation and integrated a short numpy array validator. This improves code clarity and enforces input validation.
1 parent 8425ac4 commit ba227b4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
from dataclasses import dataclass
2+
from typing import Annotated
23

3-
from ..backend_tensor import BackendTensor
4+
import numpy as np
5+
6+
from .encoders.converters import numpy_array_short_validator
47

58

69
@dataclass
7-
class GeophysicsInput():
8-
tz: BackendTensor.t
9-
densities: BackendTensor.t
10+
class GeophysicsInput:
11+
tz: Annotated[np.ndarray, numpy_array_short_validator]
12+
densities: Annotated[np.ndarray, numpy_array_short_validator]

0 commit comments

Comments
 (0)