COSIMA / cosima-cookbook

Framework for indexing and querying ocean-sea ice model output.
https://cosima-recipes.readthedocs.io/en/latest/
Apache License 2.0
57 stars 27 forks source link

Make cell_methods-derived bounds optional in getvar #294

Closed angus-g closed 2 years ago

angus-g commented 2 years ago

This is following the suggestion from https://github.com/COSIMA/cosima-cookbook/issues/284#issuecomment-1034283040, to be able to return a Dataset if we need things like time_bounds, otherwise default to a DataArray and don't attach additional attributes. I don't know if return_dataset is a particularly enlightening name, happy to take suggestions there...

Closes #284.

aidanheerdegen commented 2 years ago

I can only think of worse names than return_dataset. Like return_type='DataArray' which is kinda awful. return_bounds is more specific, but makes it harder to add other related variables (like curvilinear grid coords) if that was considered useful in the future, and doesn't indicate the type of the object returned from the function changes.

aidanheerdegen commented 2 years ago

Looks good. I am happy to merge or let you do it.