Deltares / Deltares/imod-python

Refactor: Move iMOD5 converter logic to separate module

Open
#1,319 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
41
Forks
12
Avg merge
21h 8m
Merged PRs (30d)
1

Description

We initially started putting converter logic for iMOD5 to MODFLOW6 in a separate module: imod.mf6.utilities.imod5_converter
However, as developments progressed we kind of forgot about it.

@Manangka recently pointed out here:
https://github.com/Deltares/imod-python/pull/1315#discussion_r1865813387

that converter logic is getting blended too much now with regular MODFLOW6 logic , and that it would be better to move this to the converter module. This has the following advantages:

  • Code duplication stands out better and can be reduced
  • Signatures can be easier aligned, as functions are next to each other

Requirements

  • iMOD5 converter logic should be separate from regular MODFLOW6 logic (e.g. writing MODFLOW6 files)
  • Move tests to separate test module as well
  • Preserve the method Modflow6Simulation.from_imod5_data for the public API, as it is very similar to Modflow6Simulation.from_file (for dumped models). This makes it consistent for users how to load simulations from file.

Nice to have

  • Preserve method from_imod5_data on package level as well. For example, Recharge.from_imod5_data as well similar to how there is a Recharge.from_file. It won't be a common usecase, but there are instances where users want to load an individual package, and it is convenient if that is consistent with Modflow6Simulation.from_imod5_data.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with imod.mf6.utilities.imod5_converter and compare it with the regular MODFLOW6 logic to identify converter code and its existing tests. Move the converter tests to a separate test module while preserving Modflow6Simulation.from_imod5_data, and consider the requested package-level from_imod5_data methods as a separate nice-to-have.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.