Skip to content

Commit a8bd694

Browse files
author
Lachlan Grose
committed
updating calls to regular_grid
1 parent 47be99a commit a8bd694

6 files changed

Lines changed: 15 additions & 16 deletions

File tree

LoopStructural/export/exporters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def _write_vol_evtk(model, file_name, data_label, nsteps, real_coords=True):
423423
424424
"""
425425
# Define grid spacing
426-
xyz = model.bounding_box.regular_grid(nsteps)
426+
xyz = model.bounding_box.regular_grid(nsteps=nsteps)
427427
vals = model.evaluate_model(xyz, scale=False)
428428
if real_coords:
429429
model.rescale(xyz)
@@ -465,7 +465,7 @@ def _write_vol_gocad(model, file_name, data_label, nsteps, real_coords=True):
465465
466466
"""
467467
# Define grid spacing in model scale coords
468-
xyz = model.bounding_box.regular_grid(nsteps)
468+
xyz = model.bounding_box.regular_grid(nsteps=nsteps)
469469

470470
vals = model.evaluate_model(xyz, scale=False)
471471
# Use FORTRAN style indexing for GOCAD VOXET

LoopStructural/modelling/core/geological_model.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ def create_and_add_foliation(
714714
)
715715
# add data
716716
if series_surface_data is None:
717-
series_surface_data = self.data[self.data["feature_name"] == series_surface_name]
717+
series_surface_data = self.data.loc[self.data["feature_name"] == series_surface_name]
718718

719719
if series_surface_data.shape[0] == 0:
720720
logger.warning("No data for {series_surface_data}, skipping")
@@ -789,7 +789,7 @@ def create_and_add_fold_frame(
789789
)
790790
# add data
791791
if fold_frame_data is None:
792-
fold_frame_data = self.data[self.data["feature_name"] == fold_frame_name]
792+
fold_frame_data = self.data.loc[self.data["feature_name"] == fold_frame_name]
793793
if fold_frame_data.shape[0] == 0:
794794
logger.warning(f"No data for {fold_frame_name}, skipping")
795795
return
@@ -874,13 +874,12 @@ def create_and_add_folded_foliation(
874874
**kwargs,
875875
)
876876
if foliation_data is None:
877-
foliation_data = self.data[self.data["feature_name"] == foliation_name]
877+
foliation_data = self.data.loc[self.data["feature_name"] == foliation_name]
878878
if foliation_data.shape[0] == 0:
879879
logger.warning(f"No data for {foliation_name}, skipping")
880880
return
881881
series_builder.add_data_from_data_frame(
882-
self.data[self.data["feature_name"] == foliation_data]
883-
)
882+
foliation_data )
884883
self._add_faults(series_builder)
885884
# series_builder.add_data_to_interpolator(True)
886885
# build feature
@@ -1303,7 +1302,7 @@ def create_and_add_domain_fault(
13031302
)
13041303

13051304
# add data
1306-
unconformity_data = self.data[self.data["feature_name"] == fault_surface_data]
1305+
unconformity_data = self.data.loc[self.data["feature_name"] == fault_surface_data]
13071306

13081307
domain_fault_feature_builder.add_data_from_data_frame(unconformity_data)
13091308
# look through existing features if there is a fault before an
@@ -1424,7 +1423,7 @@ def create_and_add_fault(
14241423
**kwargs,
14251424
)
14261425
if fault_data is None:
1427-
fault_data = self.data[self.data["feature_name"] == fault_name]
1426+
fault_data = self.data.loc[self.data["feature_name"] == fault_name]
14281427
if fault_data.shape[0] == 0:
14291428
logger.warning(f"No data for {fault_name}, skipping")
14301429
return

LoopStructural/modelling/features/_base_geological_feature.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def min(self):
244244
if self.model is None:
245245
return 0
246246

247-
return np.nanmin(self.evaluate_value(self.model.regular_grid((10, 10, 10))))
247+
return np.nanmin(self.evaluate_value(self.model.regular_grid(nsteps=(10, 10, 10))))
248248

249249
def max(self):
250250
"""Calculate the maximum value of the geological feature
@@ -257,7 +257,7 @@ def max(self):
257257
"""
258258
if self.model is None:
259259
return 0
260-
return np.nanmax(self.evaluate_value(self.model.regular_grid((10, 10, 10))))
260+
return np.nanmax(self.evaluate_value(self.model.regular_grid(nsteps=(10, 10, 10))))
261261

262262
def __tojson__(self):
263263
regions = [r.name for r in self.regions]

LoopStructural/modelling/intrusions/intrusion_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def create_grid_for_evaluation(self, spacing=None):
8282
if spacing is None:
8383
spacing = self.model.nsteps
8484

85-
grid_points = self.model.regular_grid(spacing, shuffle=False)
85+
grid_points = self.model.regular_grid(nsteps=spacing, shuffle=False)
8686

8787
grid_points_coord0 = self.intrusion_frame[0].evaluate_value(grid_points)
8888

LoopStructural/modelling/intrusions/intrusion_frame_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def create_grid_for_indicator_fxs(self, spacing=None):
168168
if spacing is None:
169169
spacing = self.model.nsteps
170170

171-
grid_points = self.model.regular_grid(spacing, shuffle=False)
171+
grid_points = self.model.regular_grid(nsteps=spacing, shuffle=False)
172172

173173
self.grid_to_evaluate_ifx = grid_points
174174

tests/integration/test_fold_models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_average_fold_axis():
1616
fold_frame = model.create_and_add_fold_frame("s1", nelements=10000)
1717
stratigraphy = model.create_and_add_folded_foliation(
1818
"s0",
19-
fold_frame,
19+
fold_frame=fold_frame,
2020
nelements=10000,
2121
av_fold_axis=True,
2222
# fold_axis=[-6.51626577e-06, -5.00013645e-01, -8.66017526e-01],
@@ -39,7 +39,7 @@ def test_fixed_fold_axis():
3939
fold_frame = model.create_and_add_fold_frame("s1", nelements=10000)
4040
stratigraphy = model.create_and_add_folded_foliation(
4141
"s0",
42-
fold_frame,
42+
fold_frame=fold_frame,
4343
nelements=10000,
4444
# av_fold_axis=True
4545
fold_axis=[-6.51626577e-06, -5.00013645e-01, -8.66017526e-01],
@@ -58,7 +58,7 @@ def test_fixed_wavelength():
5858
fold_frame = model.create_and_add_fold_frame("s1", nelements=10000)
5959
stratigraphy = model.create_and_add_folded_foliation(
6060
"s0",
61-
fold_frame,
61+
fold_frame=fold_frame,
6262
nelements=10000,
6363
# av_fold_axis=True
6464
fold_axis=[-6.51626577e-06, -5.00013645e-01, -8.66017526e-01],

0 commit comments

Comments
 (0)