Skip to content

Commit b749857

Browse files
authored
adding import of filter top and bottom (#1063)
Fixes #1053 # Description On importing wells, the filter top and bottom are now parsed and stored in the project file data structure # Checklist - [X] Links to correct issue - [X] Update changelog, if changes affect users - [X] PR title starts with ``Issue #nr``, e.g. ``Issue #737`` - [X] Unit tests were added - [ ] **If feature added**: Added/extended example
1 parent a31d86f commit b749857

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

docs/api/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ All notable changes to this project will be documented in this file.
66
The format is based on `Keep a Changelog`_, and this project adheres to
77
`Semantic Versioning`_.
88

9+
10+
[Unreleased- feature branch]
11+
----------------------------
12+
13+
Changed
14+
~~~~~~~
15+
- :function:`open_projectfile_data` now also imports well filter top and bottom.
16+
917
[Unreleased]
1018
------------
1119

imod/formats/prj/prj.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,9 @@ def _read_package_ipf(
806806
df_assoc["x"] = row[1]
807807
df_assoc["y"] = row[2]
808808
df_assoc["id"] = path_assoc.stem
809-
if layer <= 0:
810-
df_assoc["top"] = row[4]
811-
df_assoc["bottom"] = row[5]
809+
if "filt_top" in row._fields and "filt_bot" in row._fields:
810+
df_assoc["filt_top"] = row.filt_top
811+
df_assoc["filt_bot"] = row.filt_bot
812812
dfs.append(df_assoc)
813813
df = pd.concat(dfs, ignore_index=True, sort=False)
814814
df["rate"] = df["rate"] * factor + addition

imod/tests/test_mf6/test_import_prj.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ def test_import_ipf(tmp_path):
192192
result_snippet_1[0]["wel-3"]["dataframe"]["rate"]
193193
== 2 * result_snippet_0[0]["wel-2"]["dataframe"]["rate"] + 1.3
194194
)
195+
assert np.all(result_snippet_1[0]["wel-1"]["dataframe"]["filt_top"] == 11.0)
196+
assert np.all(result_snippet_1[0]["wel-1"]["dataframe"]["filt_bot"] == 6.0)
197+
assert np.all(result_snippet_1[0]["wel-2"]["dataframe"]["filt_top"] == 11.0)
198+
assert np.all(result_snippet_1[0]["wel-2"]["dataframe"]["filt_bot"] == 6.0)
199+
assert np.all(result_snippet_1[0]["wel-3"]["dataframe"]["filt_top"] == 11.0)
200+
assert np.all(result_snippet_1[0]["wel-3"]["dataframe"]["filt_bot"] == 6.0)
195201

196202

197203
def snippet_boundary_condition(factor: float, addition: float):

0 commit comments

Comments
 (0)