xCDAT / xcdat

An extension of xarray for climate data analysis on structured grids.
https://xcdat.readthedocs.io/en/latest/
Apache License 2.0
101 stars 11 forks source link

[Enhancement]: Slightly more flexible API for add_missing_bounds #666

Open pochedls opened 2 weeks ago

pochedls commented 2 weeks ago

Is your feature request related to a problem?

This is a convenience request. I almost always need to add missing bounds for one axis, but the (updated?) API wants a list.

Describe the solution you'd like

I'd like the API to accept a list or string (e.g., ["X", "Y"] or simply T).

Describe alternatives you've considered

No response

Additional context

No response

lee1043 commented 2 weeks ago

I like this idea!

tomvothecoder commented 2 weeks ago

Sounds good to me. These APIs also need to be updated:

pochedls commented 2 weeks ago

Hi @tomvothecoder – I'm not opposed to updating the API in these places, but does it need to be updated there?

When opening a dataset it kind of makes sense to pass in a list for most use cases (make sure this has time/lat/lon bounds no matter what...). A lot of times when you add_missing_bounds it is because you got an error and now need to fix it by adding bounds for a specific axis.

tomvothecoder commented 2 weeks ago

When opening a dataset it kind of makes sense to pass in a list for most use cases (make sure this has time/lat/lon bounds no matter what...). A lot of times when you add_missing_bounds it is because you got an error and now need to fix it by adding bounds for a specific axis.

That's true. I was thinking of consistency across APIs but the use cases aren't exactly the same. We can keep those APIs as is.