Skip to content

Commit 3ca5cca

Browse files
committed
fix: raise error for NaNs in gravity dataframe
1 parent 6ee2b6b commit 3ca5cca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/invert4geom/inversion.py

+5
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,11 @@ def run_inversion(
842842

843843
utils._check_gravity_inside_topography_region(grav_df, prism_layer) # pylint: disable=protected-access
844844

845+
# check no nans in gravity df
846+
if grav_df.res.isnull().values.any():
847+
msg = "gravity dataframe contains NaN values in the 'res' column"
848+
raise ValueError(msg)
849+
845850
log.info("starting inversion")
846851

847852
time_start = time.perf_counter()

0 commit comments

Comments
 (0)