We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This (on main) looks wrong to me:
main
In [1]: import xarray as xr In [2]: ds = xr.Dataset({'a': ('x', [0, 1])}) In [3]: ds Out[3]: <xarray.Dataset> Size: 16B Dimensions: (x: 2) Dimensions without coordinates: x Data variables: a (x) int64 16B 0 1 In [4]: ds.coords Out[4]: Coordinates: *empty* In [5]: ds.coords.dims Out[5]: FrozenMappingWarningOnValuesAccess({'x': 2})
I mean the fact no-one has raised this before means it probably isn't of much consequence, but it does seem incorrect / misleading.
Originally posted by @TomNicholas in #9451 (comment)
The issue here being that the DatasetCoordinates object displays a dim with no associated variable.
DatasetCoordinates
I'm not sure whether anything about the concept of "virtual coordinate variables" affects this.
(The FrozenMappingWarningOnValuesAccess is just a Mapping, it's only weird due to the ongoing deprecation cycle started in #8500.)
FrozenMappingWarningOnValuesAccess
Mapping
The text was updated successfully, but these errors were encountered:
Dimensions part of coordinates, even if they aren't present on coordinate variables -- we need them for correct alignment.
So I think we should add them to the repr instead, ideally something like:
>>> ds.coords <xarray.Coordinates> Dimensions: (x: 2) Coordinates: *empty*
Sorry, something went wrong.
we need them for correct alignment
Can you do xr.align on a ds.coords object?
xr.align
ds.coords
Also note how similar this question is to #9463...
DataTree.coords.__setitem__
DataTreeCoordinates
Yes, it looks like this works, though I'm a little puzzled by how :)
Regardless, you definitely need dims + coords (+ indexes) to do alignment. So it makes sense to display them in the Coordinates repr.
dims
coords
indexes
No branches or pull requests
This (on
main
) looks wrong to me:I mean the fact no-one has raised this before means it probably isn't of much consequence, but it does seem incorrect / misleading.
Originally posted by @TomNicholas in #9451 (comment)
The issue here being that the
DatasetCoordinates
object displays a dim with no associated variable.I'm not sure whether anything about the concept of "virtual coordinate variables" affects this.
(The
FrozenMappingWarningOnValuesAccess
is just aMapping
, it's only weird due to the ongoing deprecation cycle started in #8500.)The text was updated successfully, but these errors were encountered: