Configuration
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:
objectConfiguration 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
- 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
- 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
- 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
- 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:
objectxarray 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
- 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
- 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
- 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:
objectxarray 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