-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Milestone
Description
My inclination is no: the contents of a Dataset (e.g., list(ds)
, ds.keys()
and ds.values()
) should only include non-coordinates.
__contains__
checks for a coordinate (e.g., 'time'
) would need to look in ds.dimensions
or ds.coordinates
instead of ds
, but I see no need to __getitem__
: ds['time']
can still work.
Pluses:
- This change would more closely align
xray.Dataset
withpandas.DataFrame
, which also does not include any elements of the index in the contents of the frame. - It would eliminate the need for using
ds.noncoordinates
-- which, as @ToddSmall has pointed out, is not very intuitive. - In my experience, I have been using
ds.noncoordinates.items()
more often thands.items()
(which contains redundant information, as coordinates are repeated). The only time I really want to iterate over all variables in a dataset is when I'm using the lower levelVariable
API.
Negatives:
- This would break the existing API.