Skip to content

Issue #1766 river edge cases#1786

Open
JoerivanEngelen wants to merge 8 commits intomasterfrom
issue_#1766_river_edge_cases
Open

Issue #1766 river edge cases#1786
JoerivanEngelen wants to merge 8 commits intomasterfrom
issue_#1766_river_edge_cases

Conversation

@JoerivanEngelen
Copy link
Contributor

Probably Fixes #1766

Description

This fixes an edge case in the allocation of river cells when river stage == river bottom_elevation == model bottom.

Not entirely certain whether it fixes all problems @CasvHWSBrabantseDelta ran into, but it is something.

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

- Fixed edge case where allocation of :class:`imod.mf6.River` package with the
``stage_to_riv_bot`` or ``stage_to_riv_bot_drn_above`` option of
:func:`imod.prepare.ALLOCATION_OPTION` would assign river cells to the wrong
layer when was exactly equal to a bottom of a layer in the model
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you fix this sentence

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Done

option, active, top, bottom, stage, stage
)

# Override expected values
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you need to override the values here? Can't you set the expected values where you specify the cases?

Copy link
Contributor Author

@JoerivanEngelen JoerivanEngelen Mar 19, 2026

Choose a reason for hiding this comment

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

I looked into this as I was questioning the same thing; unfortunately this is not a trivial tasks. The defined expected values in the allocation option cases hold for the "normal" cases. This test tests an edge case where behavior is expected to be different for some specific combination of allocation methods and model parameters. Splitting this further into separate cases would entail quite a refactor at minimum, but I'm not even sure if its possible, and whether it would lead to a more understandable test suite.

@sonarqubecloud
Copy link

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.

[Question] Comparison stationary heads for IMOD Python run vs IMOD Batch function

2 participants