Skip to content

Use xarray Accessors for easy access to functionality #28

@cchwala

Description

@cchwala

Because we use xarray.Dataset and xarray.DataArray as our data container it would be best and most convenient to make as much functionality as possible accessible via custom xarray Accessors so that we can e.g. plot the CML paths like this

ds_cmls.plg.plot_cmls()

where plg is our custom accessor.

If we go this step, we could also make some basics functions that work in the background more general regarding their input, e.g. allow plotting colored lines by passing the coordinates and values as numpy arrays and not rely on xarray.Dataset in these "low-level functions" because one can call the functions via the xarray Accessor. The only question would where to put the detailed doc string, in the low-level function or in the accessor method.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions