Skip to content

Commit

Permalink
fix by performing check
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas committed Mar 28, 2024
1 parent beb665a commit 22f361d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion xarray/core/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
assert_no_index_corrupted,
create_default_index_implicit,
)
from xarray.core.merge import merge_coordinates_without_align, merge_coords
from xarray.core.merge import (
assert_valid_explicit_coords,
merge_coordinates_without_align,
merge_coords,
)
from xarray.core.types import DataVars, Self, T_DataArray, T_Xarray
from xarray.core.utils import (
Frozen,
Expand Down Expand Up @@ -306,6 +310,14 @@ def __init__(
else:
variables[name] = var

dims = set(d for var in variables.values() for d in var.dims)
sizes = {
d: -1 for d in dims
} # TODO the lengths here are never used, so assert_valid_explicit_coords should be refactored
assert_valid_explicit_coords(
variables, dims=sizes, explicit_coords=list(variables)
)

if indexes is None:
indexes = {}
else:
Expand Down

0 comments on commit 22f361d

Please sign in to comment.