Deltares / Deltares/imod-python

Why `expand_transient_auxiliary_variables`

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

Nobody has claimed this yet.

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

Description

I'm having trouble seeing the use of expand_transient_auxiliary_variables as a function. I don't like what it's doing either: it's duplicating data in the Datasets.

Also note that the docstring is totally unhelpful in telling me why this is required:

def expand_transient_auxiliary_variables(package: IPackage) -> None:
    """
    Splits an auxiliary dataarray of the kind that could potentially be
    time-dependent (with one or more auxiliary variable dimension) into
    dataarrays per auxiliary variable dimension. For example a concentration
    auxiliary variable in a flow package will have a species dimension, and will
    be split in several dataarrays- one for each species.
    """

The only thing I can imagine is that it might simplify the file writing, since those methods generally take a DataArray too? Or something?

Anyway, the duplication of data is in my view such a bad choice that it's worth having a slightly more complicated writer. A user may update either concentration or salinity and get unexpected results. This is unacceptable.

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 reading the expand_transient_auxiliary_variables function and its docstring, then trace where it is called during dataset handling and file writing. Check how auxiliary variables such as concentration and salinity are represented and whether the writer depends on the expanded DataArrays. Done means the purpose and duplication behavior are resolved without allowing updates to diverge unexpectedly.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.