-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
The current version of _check_dataset_form has some issues
Line 141 in 57b6b14
| def _check_dataset_form( |
-
requires_other_vars: boolis not granular enough.- there is no way to disallow additional variables
- it's unclear if the additional variables can have any name or must have an explicit one
I thought replacing
requires_other_varswith:other_vars : "allowed" | "forbidden" | "explicit" | "required", default: "allowed" Behavior when additional variables are on the Dataset - "allowed": any number of additional variables may be on the Dataset - "forbidden": only variables listed in `required_vars` are allowed - "explicit": potential additional variables must be listed in `optional_vars` - "required": additional unspecified variables are requiredis that too much?
-
I am not so sure if the logic to check for additional variables is correct & the use of
optional_varsseems strange-
there is currently the following test:
mesmer/tests/unit/test_utils.py
Line 319 in 57b6b14
ds = xr.Dataset(data_vars={"var": ("x", [0])}) mesmer/tests/unit/test_utils.py
Lines 326 to 329 in 57b6b14
with pytest.raises(ValueError, match="Expected additional variables on obj"): mesmer._core.utils._check_dataset_form( ds, optional_vars="var", requires_other_vars=True )
why does this error? There is norequired_varand there is anoptional_varsnamedvar-> so I think it should not error
-
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels