Skip to content

Commit

Permalink
fix: don't add unconformity if base feature is None
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachlan Grose committed Jun 22, 2022
1 parent f5b82eb commit be4d8ac
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions LoopStructural/modelling/core/geological_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
UnconformityFeature,
StructuralFrame,
GeologicalFeature,
FeatureType
)
from LoopStructural.modelling.features.fold import (
FoldRotationAngle,
Expand Down Expand Up @@ -345,7 +346,9 @@ def from_processor(cls, processor):
f = model.create_and_add_foliation(
s, **processor.foliation_properties[s], faults=faults
)
model.add_unconformity(f, 0)
# check feature was built, and is an interpolated feature.
if f is not None and f.type == FeatureType.INTERPOLATED:
model.add_unconformity(f, 0)
model.stratigraphic_column = processor.stratigraphic_column
return model

Expand Down Expand Up @@ -820,7 +823,7 @@ def create_and_add_foliation(
the created geological feature
"""
if self.check_inialisation() == False:
return False
return
# if tol is not specified use the model default
if tol is None:
tol = self.tol
Expand Down Expand Up @@ -1357,6 +1360,9 @@ def add_unconformity(self, feature, value):
unconformity feature
"""
if feature is None:
logger.warning(f"Cannot add unconformtiy, base feature is None")
return
self.parameters["features"].append(
{"feature_type": "unconformity", "feature": feature, "value": value}
)
Expand Down

0 comments on commit be4d8ac

Please sign in to comment.