Skip to content

Commit b29590e

Browse files
committed
[ENH] Refactor to use InterpolationOptions.from_args
Replaced direct instantiation of `InterpolationOptions` with the `from_args` class method across multiple modules and tests for consistency and improved clarity. Updated related examples and fixtures to align with this change.
1 parent 250d457 commit b29590e

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

examples/examples/real/mik.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
extent=[extent_from_data[0][0], extent_from_data[1][0], extent_from_data[0][1], extent_from_data[1][1], extent_from_data[0][2], extent_from_data[1][2]],
313313
resolution=(50, 50, 50)
314314
),
315-
interpolation_options=gp.data.InterpolationOptions(
315+
interpolation_options=gp.data.InterpolationOptions.from_args(
316316
range=5,
317317
c_o=10,
318318
mesh_extraction=True,

gempy/modules/json_io/json_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def load_model_from_json(file_path: str):
155155
default_range = 1.7 # Match standard GemPy default
156156

157157
# Create interpolation options with defaults if not provided
158-
interpolation_options = InterpolationOptions(
158+
interpolation_options = InterpolationOptions.from_args(
159159
range=data.get('interpolation_options', {}).get('kernel_options', {}).get('range', default_range),
160160
c_o=data.get('interpolation_options', {}).get('kernel_options', {}).get('c_o', 10),
161161
mesh_extraction=data.get('interpolation_options', {}).get('mesh_extraction', True),

test/test_api/test_model_construction_granular.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def test_create_structural_frame() -> StructuralFrame:
9494

9595
def test_create_interpolation_options() -> InterpolationOptions:
9696
range_ = 1000.0
97-
interpolation_options: InterpolationOptions = InterpolationOptions(
97+
interpolation_options: InterpolationOptions = InterpolationOptions.from_args(
9898
range=range_,
9999
c_o=(range_ ** 2) / 14 / 3,
100100
)

test/test_modules/test_pile/test_stratigraphic_pile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def test_structural_elements_from_borehole_set(self, borehole_set: BoreholeSet):
129129
extent=[extent_from_data[0][0], extent_from_data[1][0], extent_from_data[0][1], extent_from_data[1][1], extent_from_data[0][2], extent_from_data[1][2]],
130130
resolution=(50, 50, 50)
131131
),
132-
interpolation_options=gp.data.InterpolationOptions(
132+
interpolation_options=gp.data.InterpolationOptions.from_args(
133133
range=5,
134134
c_o=10,
135135
mesh_extraction=True,

0 commit comments

Comments
 (0)