Skip to content

properties now return dictionaries rather than lists #110

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

Merged
merged 7 commits into from
Nov 13, 2020
Merged

properties now return dictionaries rather than lists #110

merged 7 commits into from
Nov 13, 2020

Conversation

malmans2
Copy link
Member

Closes #109

.axes, .coordinates, .cell_measures, .standard_names return dictionaries mapping standard name to variable names.

.get_standard_names still returns a list of standard names.

@dcherian
Copy link
Contributor

Thanks @malmans2 Can you add a note to whats-new.rst. Another nice change would be to change describe to use these properties. That could also be left to a followup PR.

@malmans2
Copy link
Member Author

I was thinking the same, I just have to add the missing keys to the properties. I'll do the it here!

@dcherian
Copy link
Contributor

I think you could build the string for describe by looping over _AXIS_NAMES (for e.g.) and print the variable names when available in the property dicts.

@malmans2
Copy link
Member Author

malmans2 commented Nov 13, 2020

Should also .keys use .axes, .coordinates, and .cell_measures?

@malmans2
Copy link
Member Author

malmans2 commented Nov 13, 2020

Actually, is .keys the same as .standard_names.keys()?

@dcherian
Copy link
Contributor

Should also .keys use .axes, .coordinates, and .cell_measures?

Yes lets do this.

Actually, is .keys the same as .standard_names.keys()?

See #105. Right now it gives all "CF keys". Not sure what the right choice is.

@dcherian
Copy link
Contributor

Thanks @malmans2 Great to have you contribute!

@dcherian dcherian merged commit 4249cf1 into xarray-contrib:main Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to get all variables with the same standard name?
2 participants