Skip to content

Commit b285b10

Browse files
committed
fix: add exceptions for adding faults/strat from processor
1 parent 36aa3a0 commit b285b10

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

LoopStructural/modelling/core/geological_model.py

+17-10
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,15 @@ def from_processor(cls, processor):
293293
model.data = processor.data
294294
if processor.fault_properties is not None:
295295
for i in processor.fault_network.faults:
296-
model.create_and_add_fault(
297-
i,
298-
**processor.fault_properties.to_dict("index")[i],
299-
faultfunction="BaseFault",
300-
)
296+
try:
297+
298+
model.create_and_add_fault(
299+
i,
300+
**processor.fault_properties.to_dict("index")[i],
301+
faultfunction="BaseFault",
302+
)
303+
except Exception as e:
304+
logger.error(f"Error adding fault {i}\n {e}")
301305
for (
302306
edge,
303307
properties,
@@ -340,9 +344,13 @@ def from_processor(cls, processor):
340344
if processor.fault_stratigraphy is not None:
341345
faults = processor.fault_stratigraphy[s]
342346
logger.info(f"Adding foliation {s}")
343-
f = model.create_and_add_foliation(
344-
s, **processor.foliation_properties[s], faults=faults
345-
)
347+
try:
348+
f = model.create_and_add_foliation(
349+
s, **processor.foliation_properties[s], faults=faults
350+
)
351+
except Exception as e:
352+
logger.error(f"Error adding foliation {s}\n {e}")
353+
f = None
346354
if not f:
347355
logger.warning(f"Foliation {s} not added")
348356
# check feature was built, and is an interpolated feature.
@@ -1326,7 +1334,6 @@ def create_and_add_fault(
13261334
minor_axis = kwargs["fault_influence"]
13271335
if "fault_vectical_radius" in kwargs and intermediate_axis is None:
13281336
intermediate_axis = kwargs["fault_vectical_radius"]
1329-
13301337
logger.info(f'Creating fault "{fault_surface_data}"')
13311338
logger.info(f"Displacement: {displacement}")
13321339
logger.info(f"Tolerance: {tol}")
@@ -1370,7 +1377,7 @@ def create_and_add_fault(
13701377
self._add_faults(fault_frame_builder, features=faults)
13711378
# add data
13721379
fault_frame_data = self.data.loc[self.data["feature_name"] == fault_surface_data].copy()
1373-
1380+
print(fault_surface_data, fault_center)
13741381
if fault_center is not None and ~np.isnan(fault_center).any():
13751382
fault_center = self.scale(fault_center, inplace=False)
13761383
if minor_axis:

0 commit comments

Comments
 (0)