Deltares / Deltares/imod-python

[FEATURE] - Enforce descending y-coords

Open
#1,671 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

Is your feature request related to a problem? Please describe.
We quietly assume y-coords of structred grids are in descending order, but we often do not check this. Especially not for utility functions. Given that xarray has a tendency to flip coordinates into ascending order, y-coords often end up ascending. This can result into trouble such as in #825.

One way to deal with this is to create a decorator which forces descending y-coordinates for grid input and output of a function/method, similarly how we have a decorator to enforce the dim order of the output of a function/method.
An alternative would be input validation and presenting an error if y is not descending. This is already the case for the mf6 module, but I think expanding that to utility functions might be too strict and will frustrate user experience.

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 reviewing the existing decorator that enforces output dimension order and the input validation already used by the mf6 module. Decide whether grid utilities should enforce descending y-coordinates through a decorator or reject ascending coordinates, then define tests covering grid inputs and outputs and the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.