Skip to content

Commit

Permalink
fix: recursive error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lachlan Grose committed Jul 20, 2022
1 parent 728fc5f commit f3180f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 4 additions & 5 deletions LoopStructural/modelling/features/_geological_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def __init__(
self.builder = builder
self.type = FeatureType.INTERPOLATED


def is_valid(self):
return self.interpolator.valid

Expand Down Expand Up @@ -103,10 +102,10 @@ def evaluate_value(self, evaluation_points):
mask[:] = True
# check regions
for r in self.regions:
try:
mask = np.logical_and(mask, r(evaluation_points))
except:
logger.error("nan slicing")
# try:
mask = np.logical_and(mask, r(evaluation_points))
# except:
# logger.error("nan slicing")
# apply faulting after working out which regions are visible
if self.faults_enabled:
for f in self.faults:
Expand Down
8 changes: 6 additions & 2 deletions LoopStructural/modelling/features/_unconformity_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class UnconformityFeature(GeologicalFeature):
""" """

def __init__(self, feature: GeologicalFeature, value: float):
def __init__(self, feature: GeologicalFeature, value: float, sign=True):
"""
Parameters
Expand All @@ -26,6 +26,7 @@ def __init__(self, feature: GeologicalFeature, value: float):
)
self.value = value
self.type = FeatureType.UNCONFORMITY
self.sign = sign

def evaluate(self, pos):
"""
Expand All @@ -40,4 +41,7 @@ def evaluate(self, pos):
boolean
true if above the unconformity, false if below
"""
return self.evaluate_value(pos) < self.value
if self.sign:
return self.evaluate_value(pos) < self.value
if not self.sign:
return self.evaluate_value(pos) > self.value

0 comments on commit f3180f3

Please sign in to comment.