-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
A key feature of xarray.Dataset
is that all dimensions of the same name must have the same sizes across DataArrays. For this reason, a Dataset schema that requires different sizes for dimensions of the same name will never match any Datasets. I suggest that it should be an an error to construct such a schema. This would allow early detection of such erroneous schemas.
So with this feature, the following test would pass:
def test_forbid_internally_inconsistent_schema():
with pytest.raises(Exception):
schema =DatasetSchema(
data_vars={
"v1":DataArraySchema(shape=ShapeSchema((2,)), dims=("dim_1",)),
"v2": DataArraySchema(shape=ShapeSchema((3,)), dims=("dim_1",)),
}
jhamman
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers