Skip to content

Issue #1316 msw model from imod5 data#1328

Merged
JoerivanEngelen merged 53 commits into
issue_#1260_from_imod5_data_metaswapfrom
issue_#1316_msw_model_from_imod5_data
Dec 12, 2024
Merged

Issue #1316 msw model from imod5 data#1328
JoerivanEngelen merged 53 commits into
issue_#1260_from_imod5_data_metaswapfrom
issue_#1316_msw_model_from_imod5_data

Conversation

@JoerivanEngelen

@JoerivanEngelen JoerivanEngelen commented Dec 9, 2024

Copy link
Copy Markdown
Contributor

Fixes #1316

Description

Adds MetaSwapModel.from_imod5_data, currently only models can be written by turning off validation, that is still something to pick up.

  • Adds MetaSwapModel.from_imod5_data
  • Converts Imod5DataDict TypeAlias to TypedDict, with which we can avoid a lot of type casting.
  • Add masking and broadcasting utilities for MetaSWAP iMOD5 data. I could not easily make calls to the MODFLOW6 utilities for masking, as these assumed presence of a layer coordinate and had logic to deal with that, which is irrelevant for MetaSWAP.
  • Adds MetaSwapActive dataclass to store masks
  • Allow user-defined settings upon initialization, instead of only supporting default settings.
  • Add validate argument to MetaSwapModel.write to turn off model validation upon writing.

Checklist

  • Links to correct issue
  • Update changelog, if changes affect users
  • PR title starts with Issue #nr, e.g. Issue #737
  • Unit tests were added
  • If feature added: Added/extended example

Comment thread docs/api/msw.rst
Comment thread imod/msw/infiltration.py Outdated
Comment thread imod/msw/model.py
"""
extra_paths = imod5_data["extra"]["paths"]
path_to_parasim = find_in_file_list("para_sim.inp", extra_paths)
parasim_settings = read_para_sim(path_to_parasim)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if path_to_parasim is empty? Should this be put in an if statement?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All iMOD5 usecases contain this file in the "EXTRA" section in the projectfile: Without it they couldn't run their MetaSWAP model with iMOD5. If the para_sim.inp is missing an error will be thrown: "could not find para_sim.inp in list of paths: ..."

Comment thread imod/msw/utilities/parse.py
Comment thread imod/msw/utilities/parse.py Outdated
Comment thread imod/tests/test_msw/test_infiltration.py
@sonarqubecloud

Copy link
Copy Markdown

@JoerivanEngelen JoerivanEngelen merged commit bec1beb into issue_#1260_from_imod5_data_metaswap Dec 12, 2024
@JoerivanEngelen JoerivanEngelen deleted the issue_#1316_msw_model_from_imod5_data branch December 12, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants