-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Consistent use of abbreviations: attrs, dims, coords #190
New issue
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
Comments
There is at least one major advantage to using abbreviations: less typing and shorter lines of code! e.g., compare: x = xray.Coord('x', np.arange(10))
y = xray.Coord('y', ['a', 'b', 'c'])
arr = xray.DataArray(data, dims=['x', 'y'], coords=[x, y])
'x' in arr.dims and x = xray.Coordinate('x', np.arange(10))
y = xray.Coordinate('y', ['a', 'b', 'c'])
arr = xray.DataArray(data, dimensions=['x', 'y'], coordinates=[x, y])
'x' in arr.dimensions h5py does use These are pretty common/obvious abbreviations and they are fundamental enough that I would not worry about imposing them on our users. Right now, I am leaning toward switching to always using |
Actually, I am going to go ahead and rename Otherwise everything was done in #194. |
Right now, we use
ds.attrs
but the keyword argument is stillattributes
. We should resolve this inconsistency.We also use
dimensions
andcoordinates
instead of the natural abbreviationsdims
andcoords
(althoughdims
is used in theVariable
constructor). Should we switch to the abbreviated versions for consistency withattrs
?Note that I switched to
attrs
in part because of its use in other packages (h5py, pytables and blz). There is not as clear precedent for what to call dimensions and coordinates.The text was updated successfully, but these errors were encountered: