Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

primod: Update mapping objects to update to iMOD Python's refactoring plans #342

Closed
JoerivanEngelen opened this issue Oct 25, 2024 · 0 comments · Fixed by #352
Closed

primod: Update mapping objects to update to iMOD Python's refactoring plans #342

JoerivanEngelen opened this issue Oct 25, 2024 · 0 comments · Fixed by #352
Assignees

Comments

@JoerivanEngelen
Copy link
Contributor

JoerivanEngelen commented Oct 25, 2024

I need to refactor iMOD Python's MetaSWAP objects, see Deltares/imod-python#1255. This has the following consequences for primod:

Part 1 of this refactoring consists of changing the well argument for the coupling objects from imod.mf6.wel.WellDisStructured to imod.mf6.mf6_wel_adapter.Mf6Wel. The latter is a direct data representation of the MODFLOW 6 WEL file. More can be read here Deltares/imod-python#728. This has the following consequences for iMOD Coupler:

  • The imod.mf6.mf6_wel_adapter.Mf6Wel object needs to be provided to coupling objects as argument instead of the deprecated imod.mf6.wel.WellDisStructured.
  • WellSvatMapping.self._create_well_id needs to be updated
  • Test fixtures need to be updated.

Part 2 is a larger refactoring, where this Mf6Wel object will be an argument of the Sprinling.write and CouplerMapping.write methods, instead of the initialization. More can be read here Deltares/imod-python#1255. This will require the following updates to primod:

  • In MetaMod.write, Mf6Wells need to be fetched from self.mf6_simulation and provided to self.metaswap.write.
  • In MetaModDriverCoupling.derive_coupling, Mf6Wells need to be fetched from gwf_model
  • Test fixtures need to be updated.
  • More?

As I need to run primod against a dev version of iMOD Python, this also means I need to temporarily modify the pixi.toml, to use a install from git with pip, instead of a install from conda-forge.

@JoerivanEngelen JoerivanEngelen self-assigned this Oct 25, 2024
@github-project-automation github-project-automation bot moved this to 📯 New in iMOD Suite Oct 25, 2024
@JoerivanEngelen JoerivanEngelen moved this from 📯 New to 📝Refined in iMOD Suite Oct 25, 2024
JoerivanEngelen added a commit that referenced this issue Nov 13, 2024
Make iMOD Coupler compatible with iMOD Python 0.18.0:

* Use Mf6Wel object instead of WellDisStructuredDis

* Provide WEL at write instead of at init.

* Derive Mf6Wel package from coupler dict

* Drop unused "layer" coord that was causing trouble

* Set fill value to -1 for rasterio >=1.3.10

* Set dtype explicitly after imod-python update. Otherwise defaults to using the dtype of like, which is an integer. This causes problem for the fill value "nan" which the ribamod coupling depends on.

* Use special method to get diskey, for future support of unstructured grids

* Make sprinkling optional and improve function name.

* Add unittest for get_mf6_pkgs_with_coupling_dict

* Update remove sprinkling function, as initialization of Coupling object is not necessary anymore.

* Add pandera dependency

* Use python-build instead of build, as build-feedstock has been archived

* Force pandas > 2.0, otherwise ribasim-test-models doesn't work

* fix mypy error: unused type: ignore comment

* Cast to geodataframe to work around mypy error.
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in iMOD Suite Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant