diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1ebeb10..493ef8d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,7 +7,8 @@ on: - cron: '0 9 * * 1' # run every Monday at 9 AM UTC (3 am PST) push: pull_request: - + workflow_dispatch: + jobs: build: name: ${{ matrix.python-version }}, ${{ matrix.os }} diff --git a/mfexport/array_export.py b/mfexport/array_export.py index 8257bdd..095acf2 100644 --- a/mfexport/array_export.py +++ b/mfexport/array_export.py @@ -162,14 +162,16 @@ def export_array_contours(filename, a, modelgrid, level = [] for ctr in contours: levels = ctr.levels - for i, c in enumerate(ctr.collections): - paths = c.get_paths() - for path in paths: - # break the paths up into their components - # (so that different instances of a contour level - # don't connect across other contour levels) + #for i, c in enumerate(ctr.collections): + # paths = c.get_paths() + paths = ctr.get_paths() + for i, path in enumerate(paths): + # break the paths up into their components + # (so that different instances of a contour level + # don't connect across other contour levels) + if len(path) > 0: parts = np.split(path.vertices, - np.where(path.codes == 1)[0], axis=0) + np.where(path.codes == 1)[0], axis=0) parts = [p for p in parts if len(p) > 0] geoms += [LineString(p) if len(p) > 1 else LineString() for p in parts] level += list(np.ones(len(parts)) * levels[i]) diff --git a/mfexport/budget_output.py b/mfexport/budget_output.py index 624102a..3e43378 100644 --- a/mfexport/budget_output.py +++ b/mfexport/budget_output.py @@ -633,7 +633,7 @@ def read_maw_output(maw_head_file, maw_budget_file, data = pd.read_csv(f, names=names, skiprows=skiprows, sep='\\s+') - data = data.loc[data['mawsetting'] != 'status'] + data = data.loc[data[names[1]] != 'status'] data = data.pivot(index=data.columns[0], columns=data.columns[1], values=data.columns[2]) data.reset_index(inplace=True) diff --git a/mfexport/tests/data/maw/packagedata.dat b/mfexport/tests/data/maw/packagedata.dat new file mode 100644 index 0000000..bdd6d62 --- /dev/null +++ b/mfexport/tests/data/maw/packagedata.dat @@ -0,0 +1,19 @@ +#wellno radius bottom strt condeqn ngwfnodes boundname +1 0.1016 231.34 284.16 mean 3 B1 +2 0.1016 204.22 279.36 mean 6 B3 +3 0.1016 196.6 278.18 mean 7 B4 +4 0.1016 210.01 278.7 mean 6 B5 +5 0.1016 203.91 277.89 mean 5 B6 +6 0.1651 171.91 277.63 mean 5 B8 +7 0.1016 169.77 277.94 mean 4 B9 +8 0.1016 239.88 287.05 mean 2 B13 +9 0.1016 251.76 291.18 mean 2 SC1 +10 0.1016 241.4 294.43 mean 2 SC2 +11 0.1016 235.31 290.53 mean 3 SC5 +12 0.1016 248.56 297.28 mean 2 SC6 +13 0.1016 249.23 296.4 mean 2 SC7 +14 0.1016 247.47 296.32 mean 2 SC8 +15 0.1016 251.34 291.14 mean 1 SC9 +16 0.1016 253.17 291.55 mean 2 SC10 +17 0.1016 250.73 290.66 mean 1 SC11 +18 0.1016 240.33 296.4 mean 3 SC12