eradiate.converters#

eradiate.converters.auto_or(wrapped_converter)[source]#

A converter that allows an attribute to be set to AUTO.

Parameters

wrapped_converter (callable()) – The converter that is used for non-AUTO values.

Returns

callable()

eradiate.converters.load_dataset(value)[source]#

Try to load an xarray dataset from the passed value:

  • if value is a string or path-like object, it attempts to load a dataset from that location;

  • if the previous step fails, it tries to serve it from the data store;

  • if value is an xarray dataset, it is returned directly;

  • otherwise, a ValueError is raised.

eradiate.converters.on_quantity(wrapped_converter)[source]#

Apply a converter to the magnitude of a pint.Quantity.

Parameters

wrapped_converter (callable()) – The converter which will be applied to the magnitude of a pint.Quantity.

Returns

callable()