Skip to content

should cf-xarray change the meaning of .keys? #105

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

Open
dcherian opened this issue Oct 13, 2020 · 1 comment
Open

should cf-xarray change the meaning of .keys? #105

dcherian opened this issue Oct 13, 2020 · 1 comment
Labels
opinion wanted User input requested

Comments

@dcherian
Copy link
Contributor

After merging #104, I remembered that xarray Datasets have .keys method which returns a list of variable names in Dataset.data_vars.

#104 added .cf.keys that replaced .cf.get_valid_keys (i.e. .cf.keys returns a List of valid "special keys"). This changes cf_xarray's usual position of not changing the "meaning" of any existing xarray method.

I am unsure of whether we actually want to do this.

  1. Something like .cf.get_valid_keys() is useful, I think; though it may be less useful now that we have .cf.axes and friends. Is there a better name for this function?
  2. Should .cf.keys() instead return a list of "special keys" in ds.data_vars? I don't know if this is that useful either...

Thoughts?

@kthyng
Copy link
Contributor

kthyng commented Oct 21, 2020

If you don't want to overlap with xarray commands, then probably shouldn't use cf.keys() anymore. I lean slightly toward skipping it altogether since the individual categories could be combined together to get the same thing and I don't see it as being used enough to justify a shortcut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
opinion wanted User input requested
Projects
None yet
Development

No branches or pull requests

2 participants