-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't working
Description
This function:
def _get_period_varnames(self) -> list[str]:
"""
Get variable names for transient data of this package.
Returns
-------
list[str]
List of variable names that are used for transient data in this
package.
Examples
--------
To get the variable names for transient data in a package, e.g. a River
package:
>>> river = imod.mf6.River.from_file("river_with_concentration.nc")
>>> river._get_period_varnames()
>>> # prints: ['stage', 'conductance', 'bottom_elevation', 'concentration']
"""
result = []
if hasattr(self, "_period_data"):
result.extend(self._period_data)
if hasattr(self, "_auxiliary_data"):
result.extend(get_variable_names(self))
return resultDoes not return what the docstring mentions: ['stage', 'conductance', 'bottom_elevation', 'concentration'].
Instead of "concentration", it returns the name of species. This is due to how get_variable_names works, and the fact that _auxiliary_data is a dict.
This has rather bad effects; in _get_unfiltered_pkg_options, not_options should be skipped. Currently, it will read the entire concentration array into memory as .values[()] is called.
However, changing the function to:
if hasattr(self, "_auxiliary_data"):
result.extend(self._auxiliary_data.keys())Seems to result in other errors, so it looks like other functionality relies on the incorrect behavior!
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
📯 New