From f3647872e40ea40aa4543f7d3d965b6960bf756a Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Tue, 13 Feb 2024 20:00:08 -0500 Subject: [PATCH] restore minimal modpath fields for plotting --- flopy/plot/plotutil.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flopy/plot/plotutil.py b/flopy/plot/plotutil.py index 9ec30afe25..cef94770c7 100644 --- a/flopy/plot/plotutil.py +++ b/flopy/plot/plotutil.py @@ -2681,6 +2681,7 @@ def parse_modpath_selection_options( ("cellface", np.int32), ] ) +MP_MIN_PLOT_FIELDS = ["x", "y", "z", "time", "k", "particleid"] def to_mp7_pathlines( @@ -2709,12 +2710,12 @@ def to_mp7_pathlines( # check format dt = data.dtypes if not ( - all(n in dt for n in MP7_PATHLINE_DTYPE.fields.keys()) + all(n in dt for n in MP_MIN_PLOT_FIELDS) or all(n in dt for n in PRT_PATHLINE_DTYPE.fields.keys()) ): raise ValueError( "Pathline data must contain the following fields: " - f"{MP7_PATHLINE_DTYPE.fields.keys()} for MODPATH 7, or " + f"{MP_MIN_PLOT_FIELDS} for MODPATH 7, or " f"{PRT_PATHLINE_DTYPE.fields.keys()} for MODFLOW 6 PRT" ) @@ -2795,12 +2796,12 @@ def to_mp7_endpoints( data if ret_type == pd.DataFrame else data.to_records(index=False) ) if not ( - all(n in dt for n in MP7_PATHLINE_DTYPE.fields.keys()) + all(n in dt for n in MP_MIN_PLOT_FIELDS) or all(n in dt for n in PRT_PATHLINE_DTYPE.fields.keys()) ): raise ValueError( "Pathline data must contain the following fields: " - f"{MP7_PATHLINE_DTYPE.fields.keys()} for MODPATH 7, or " + f"{MP_MIN_PLOT_FIELDS} for MODPATH 7, or " f"{PRT_PATHLINE_DTYPE.fields.keys()} for MODFLOW 6 PRT" )