Configuration#

class ccres_weather_station.config.config.Config(variables: Dict[str, ccres_weather_station.config.config.VariableConfig], coords: Dict[str, ccres_weather_station.config.config.CoordConfig], attrs: Dict[str, str])[source]#

Bases: object

Configuration object containing metdata.

  • the variables names

  • the default metadata for global attributes

  • the default metadata for variables attributes

add_config_from_toml(path: Union[str, pathlib.Path]) ccres_weather_station.config.config.Config[source]#

Integrate another config file to object.

The new file have precedence over the old one. That say, if a field already exists in the object and is present in the incoming config file, it will be overwrited

Parameters

path (PathLike) – Path of the Toml file

Returns

Updated config file

Return type

Config

attrs: Dict[str, str][source]#
coords: Dict[str, ccres_weather_station.config.config.CoordConfig][source]#
classmethod default() ccres_weather_station.config.config.Config[source]#

Create the object from a default config file.

It creates the object from a valid default Toml file

Returns

The interpretation of the Toml file

Return type

Config

classmethod from_toml(path: Union[str, pathlib.Path]) ccres_weather_station.config.config.Config[source]#

Class method handling the creation of the object.

It creates the object from a valid Toml configuration file

Parameters

path (PathLike) – Path of the Toml file

Returns

The interpretation of the Toml file

Return type

Config

variables: Dict[str, ccres_weather_station.config.config.VariableConfig][source]#
class ccres_weather_station.config.config.CoordConfig(name: str, meta: ccres_weather_station.config.config.CoordMeta, encoding: ccres_weather_station.config.config.CoordEncoding)[source]#

Bases: object

encoding: ccres_weather_station.config.config.CoordEncoding[source]#
meta: ccres_weather_station.config.config.CoordMeta[source]#
name: str[source]#
class ccres_weather_station.config.config.CoordEncoding(zlib: Optional[bool] = None, shuffle: Optional[bool] = None, complevel: Optional[int] = None, fletcher32: Optional[bool] = None, contiguous: Optional[bool] = None, chunksizes: Optional[int] = None, dtype: Optional[str] = None, units: Optional[str] = None, calendar: Optional[str] = None)[source]#

Bases: object

xarray encoding wrapper for coordinates.

Notes

The dtype must be numpy-like but without the np. So instead of np.float32, we need float32

Notes

See https://docs.xarray.dev/en/stable/user-guide/io.html #reading-encoded-data

calendar: Optional[str] = None[source]#
chunksizes: Optional[int] = None[source]#
complevel: Optional[int] = None[source]#
contiguous: Optional[bool] = None[source]#
dtype: Optional[str] = None[source]#
fletcher32: Optional[bool] = None[source]#
shuffle: Optional[bool] = None[source]#
units: Optional[str] = None[source]#
zlib: Optional[bool] = None[source]#
class ccres_weather_station.config.config.CoordMeta(standard_name: Optional[str] = None, long_name: Optional[str] = None, units: Optional[str] = None, calendar: Optional[str] = None)[source]#

Bases: object

calendar: Optional[str] = None[source]#
long_name: Optional[str] = None[source]#
standard_name: Optional[str] = None[source]#
units: Optional[str] = None[source]#
class ccres_weather_station.config.config.VariableConfig(name: str, meta: ccres_weather_station.config.config.VariableMeta, encoding: ccres_weather_station.config.config.VariableEncoding)[source]#

Bases: object

encoding: ccres_weather_station.config.config.VariableEncoding[source]#
meta: ccres_weather_station.config.config.VariableMeta[source]#
name: str[source]#
class ccres_weather_station.config.config.VariableEncoding(zlib: Optional[bool] = None, shuffle: Optional[bool] = None, complevel: Optional[int] = None, fletcher32: Optional[bool] = None, contiguous: Optional[bool] = None, chunksizes: Optional[int] = None, dtype: Optional[str] = None, units: Optional[str] = None, calendar: Optional[str] = None)[source]#

Bases: object

xarray encoding wrapper for variables.

Notes

The dtype must be numpy-like but without the np. So instead of np.float32, we need float32

Notes

See https://docs.xarray.dev/en/stable/user-guide/io.html #reading-encoded-data

calendar: Optional[str] = None[source]#
chunksizes: Optional[int] = None[source]#
complevel: Optional[int] = None[source]#
contiguous: Optional[bool] = None[source]#
dtype: Optional[str] = None[source]#
fletcher32: Optional[bool] = None[source]#
shuffle: Optional[bool] = None[source]#
units: Optional[str] = None[source]#
zlib: Optional[bool] = None[source]#
class ccres_weather_station.config.config.VariableMeta(standard_name: Optional[str] = None, long_name: Optional[str] = None, units: Optional[str] = None, comment: Optional[str] = None, instrument: Optional[str] = None, cell_methods: Optional[str] = None)[source]#

Bases: object

cell_methods: Optional[str] = None[source]#
comment: Optional[str] = None[source]#
instrument: Optional[str] = None[source]#
long_name: Optional[str] = None[source]#
standard_name: Optional[str] = None[source]#
units: Optional[str] = None[source]#