Skip to content

Issue #963 dump meta swap model nc#1852

Merged
JoerivanEngelen merged 16 commits into
masterfrom
Issue_#963_dump_MetaSWAP_model_nc
Jun 15, 2026
Merged

Issue #963 dump meta swap model nc#1852
JoerivanEngelen merged 16 commits into
masterfrom
Issue_#963_dump_MetaSWAP_model_nc

Conversation

@rleander73

@rleander73 rleander73 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #963

Description

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
  • If feature added: Added feature to API documentation
  • If pixi.lock was changed: Ran pixi run generate-sbom and committed changes

@JoerivanEngelen JoerivanEngelen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, the changeset is quite complete and the roundtrip tests are good.

I have some comments though:

  1. There is duplicate code in imod.mf6.Model.dump, which is never called now because imod.mf6.Modflow6Simulation doesn't call it anymore... See my detailed comments.

  2. It's very useful you added the iModel interface to MetaSwapModel. You had to add some methods to comply with the iModel interface. Unfortunately the masking methods do not work as some important methods are missing. Implementing that in this PR is out of scope, but could you add a NotImplementedError here? Furthermore could you add unittests for the others that we still think work? If it turns out in the unittests that they do not work, also replace these with a NotImplmentedError. List of methods/properties that still deserve a unittest:

    • _is_splitting_supported
    • _is_regridding_supported
    • _is_clipping_supported
    • model_id
    • options
    • domain

Comment thread imod/common/utilities/dump_model.py Outdated
Comment thread imod/common/utilities/dump_model.py
Comment thread imod/mf6/model.py Outdated
Comment thread imod/mf6/simulation.py Outdated
Comment thread imod/msw/model.py Outdated
Comment thread imod/msw/model.py Outdated
Comment thread imod/msw/model.py Outdated
Comment thread imod/msw/pkgbase.py Outdated
Comment thread imod/tests/test_mf6/test_mf6_model.py Outdated
Comment thread imod/tests/test_msw/test_model.py

@JoerivanEngelen JoerivanEngelen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, using the IDict interface simplified things a lot! I like the work you put into generalizing the dump logic into a common utility. I have one minor remark about the docstring, as that looked a bit fishy to me so please have a look at that. Approving in advance. Thanks!

Comment thread imod/mf6/model.py Outdated
experimental option which creates a zipped zarr store in a single
file, which is easier to copy and automatically compresses data as
well. Default is ``'netcdf4'``.
Dump simulation to files. Writes a model definition as .TOML file, which

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see you added whitespace here. Was this necessary to get the docs rendered properly, or is by accident?

@sonarqubecloud

Copy link
Copy Markdown

@JoerivanEngelen JoerivanEngelen merged commit 1a28c13 into master Jun 15, 2026
8 checks passed
@JoerivanEngelen JoerivanEngelen deleted the Issue_#963_dump_MetaSWAP_model_nc branch June 15, 2026 09:43
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.

Add dump method to MetaSWAP model

3 participants