Skip to content

Commit

Permalink
fix: allow wiggle room for enforcing confining surfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed May 7, 2024
1 parent 99a7ade commit 7e4e0b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/invert4geom/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,18 +584,19 @@ def enforce_confining_surface(
df.loc[i, f"iter_{iteration_number}_correction"] = df.max_change_below[
i
]

logging.info("enforced lower confining surface at %s prisms", number_enforced)

# check that when constrained correction is added to topo it doesn't intersect
# either bounding layer
updated_topo: pd.Series[float] = df[f"iter_{iteration_number}_correction"] + df.topo
if "upper_bounds" in df and np.any((df.upper_bounds - updated_topo) < 0):
if "upper_bounds" in df and np.any((df.upper_bounds - updated_topo) < -0.001):
msg = (
"Constraining didn't work and updated topography intersects upper "
"constraining surface"
)
raise ValueError(msg)
if "lower_bounds" in df and np.any((updated_topo - df.lower_bounds) < 0):
if "lower_bounds" in df and np.any((updated_topo - df.lower_bounds) < -0.001):
msg = (
"Constraining didn't work and updated topography intersects lower "
"constraining surface"
Expand Down

0 comments on commit 7e4e0b0

Please sign in to comment.