Deltares / Deltares/imod-python

Add classmethod to construct BoundaryCondition from iMOD5 data

Open
#994 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

After #961 is fixed, we can expand this method for the BoundaryCondition package to do:

  • Test if planar grid included (no layer)
  • Allocate cells (for RCH, GHB, RIV, DRN)
  • Distribute conductances (for GHB, RIV, DRN)

This can be done in function with something like maybe_allocate_to_layers()


class BoundaryCondition:
...
    @classmethod
    def from_imod5_package(cls, dis_pkg, npf_pkg, **data):
        # target grid is idomain
        target = dis_pkg.dataset["idomain"]
        # Regrid to one consistent dataset
        dataset = cls._regrid_like(target, **data)
        # Allocate to layers, if has planar grids
        dataset_allocated = maybe_allocate_to_layers(dataset, dis_pkg, npf_pkg)
        return cls(**dataset_allocated)
...

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

Review issue #961 first, then locate the BoundaryCondition package and its proposed from_imod5_package entry point. Trace _regrid_like and the proposed maybe_allocate_to_layers flow using dis_pkg, npf_pkg, and the provided data. Done means planar grids are detected, cells are allocated for RCH, GHB, RIV, and DRN, and conductances are distributed for GHB, RIV, and DRN.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.