From 08f6921745e56397b13a85077e766dfafc195e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ruben=20Calj=C3=A9?= Date: Tue, 27 Aug 2024 12:12:08 +0200 Subject: [PATCH] Fix reading of strat_props layer "NA" would result in NaN --- nlmod/read/geotop.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nlmod/read/geotop.py b/nlmod/read/geotop.py index 772851d2..aa638968 100644 --- a/nlmod/read/geotop.py +++ b/nlmod/read/geotop.py @@ -42,7 +42,7 @@ def get_lithok_colors(): def get_strat_props(): fname = os.path.join(NLMOD_DATADIR, "geotop", "REF_GTP_STR_UNIT.csv") - df = pd.read_csv(fname) + df = pd.read_csv(fname, keep_default_na=False, na_values="") # rename the columns to previously used values # so existing nlmod-code will keep working df = df.rename( @@ -122,10 +122,6 @@ def to_model_layers( if strat_props is None: strat_props = get_strat_props() - # stap 2 create layer for each stratigraphy unit (geo-eenheid) - if strat_props is None: - strat_props = get_strat_props() - # get all strat-units in Dataset strat = geotop_ds["strat"].values units = np.unique(strat)