Skip to content

Get ride of "noncoordinates" as a name? #212

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

Closed
shoyer opened this issue Aug 14, 2014 · 8 comments
Closed

Get ride of "noncoordinates" as a name? #212

shoyer opened this issue Aug 14, 2014 · 8 comments

Comments

@shoyer
Copy link
Member

shoyer commented Aug 14, 2014

As @ToddSmall has pointed out (in #202), "noncoordinates" is a confusing name -- it's something defined by what it isn't, not what it is.

Unfortunately, our best alternative is "variables", which already has a lot of meaning from the netCDF world (and which we already use).

Related: #211

@shoyer shoyer added this to the 0.3 milestone Aug 14, 2014
@shoyer
Copy link
Member Author

shoyer commented Sep 4, 2014

I'm now thinking that I would like to rename the current Variable and Coordinate objects to Block and IndexBlock. The name is borrowed from the pandas.Block object which they resemble. The main distinction from pandas is that our blocks have a bit more associated metadata (dims, attrs and encoding). Thoughts?

Once we rename variables to blocks (at least for the public API), we can safely use the name "variables" in place of "noncoordinates". DataStores should also probably switch to calling their contents "blocks" instead of "variables" (cc @akleeman).

@akleeman
Copy link
Contributor

akleeman commented Sep 4, 2014

I personally am not familiar with pandas.Block objects, so I find the name uniformative. That combined with the fact that renaming Variable to Block would break alignment with netCDF naming conventions (so confuse users coming from that background) makes me hesitant about the change. I think I'd be more excited about finding a better name for noncoordinates (fields? ) instead of renaming variables (which would also cause non-backwards compatibility)

@shoyer
Copy link
Member Author

shoyer commented Sep 5, 2014

I don't think it's that terrible to be cryptic with the name for the xray.Variable object, because this object isn't really part of the public API. But I do agree that the connection with netCDF naming conventions is nice.

Also, to clarify, I was thinking of only identifying non-coordinates as "variables" in Dataset.__repr__. I agree that the property ds.variables should not be reused for something other than what it currently is.

@shoyer
Copy link
Member Author

shoyer commented Sep 5, 2014

How about calling the arrays in a Dataset "store arrays" or just "arrays" for short?

  • Variable -> StoreArray
  • Coordinate -> IndexArray
  • Dataset.variables -> Dataset.arrays
  • DataArray.variable -> DataArray.array

@shoyer
Copy link
Member Author

shoyer commented Sep 5, 2014

I guess this is coming full circle back to the name XArray now...

@shoyer
Copy link
Member Author

shoyer commented Sep 5, 2014

New proposal... don't even bother renaming Variable and Coordinate, but switch Dataset.variables to Dataset.arrays and DataArray.variable to DataArray.array. Really, I just want to eliminate the confusing Dataset attribute... and arrays is shorter anyways.

shoyer added a commit to shoyer/xarray that referenced this issue Sep 12, 2014
Related: pydata#212

Dataset.variables was too confusing with our current usage of
"variables", but I'm not 100% sure I'm happy with `Dataset.arrays`
either.

So for now, I've just renamed `Dataset._variables` to
`Dataset._arrays` and removed `Dataset.variables` entirely.
@shoyer
Copy link
Member Author

shoyer commented Sep 18, 2014

@akleeman What do you think of removing access to the underlying array of xray.Variable objects entirely from the public dataset API? I think that is my preference... nobody really wants to work with those objects, anyways.

@shoyer
Copy link
Member Author

shoyer commented Sep 22, 2014

This has been resolved per my last comment.

@shoyer shoyer closed this as completed Sep 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants