Deltares / Deltares/imod-python

[FEATURE] - Add cleanup methods for static packages

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

Nobody has claimed this yet.

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

Description

Is your feature request related to a problem? Please describe.
We have nice cleanup methods for boundary condition packages, but not for static packages. This requires users now to come up with their own fixes.

Describe the solution you'd like

From the top of my mind:

DIS/DISV

  1. Set idomain cells with thickness == 0 (or smaller than some tolerance limit) from 1 to -1
  2. top needs to be masked with idomain > 0 of the first layer
  3. bottom needs to be masked with a dataset that is shifted across the layer dim, so that underlying active cells still have a top

I'm not entirely sure about 1. and 2., as they can result in confusing results. idomain is normally treated in the codebase as the single source of truth. "Fixing" it is a bit dodgy.

NPF

  1. Mask all k-values smaller than 0.0
  2. Mask everything where idomain <= 0
  3. Enforce icelltype as integer

I'm not so sure about 3, as it could result potentially in suprising results due to floating point precision errors.

STO

  1. Mask everything where idomain <= 0

IC

  1. Fill missing values with a laplace interpolation
  2. Mask everything where idomain <= 0

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 by locating the existing cleanup methods for boundary-condition packages and the implementations of the DIS/DISV, NPF, STO, and IC packages. Review how idomain, layer shifts, masking, and missing values are currently handled. Done requires agreed cleanup behavior for each listed package, with tests covering the selected rules and their edge cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.