RUFAS.routines.manure.IO_helpers.manure_manager_config_handler module#

class RUFAS.routines.manure.IO_helpers.manure_manager_config_handler.ManureManagerConfigHandler(manure_manager_config: dict[str, Any])#

Bases: object

A class that manages the custom manure manager configs.

__init__(manure_manager_config: dict[str, Any]) None#

Initializes the ManureManagerConfigHandler class.

Parameters#

manure_manager_configdict[str, Any]

The manure manager config dictionary that contains all the manure manager config information.

get_bedding_config(bedding_name: str) BeddingConfig#

Returns the bedding config for the given bedding type name.

Parameters#

bedding_namestr

The name of the bedding configuration for which to get the config.

Returns#

BeddingConfig

The bedding config associated with the given bedding name.

get_manure_handler_config(manure_handler_type_name: str) ManureHandlerConfig#

Returns the manure handler config for the given manure handler type name.

Parameters#

manure_handler_type_namestr

The name of the manure handler type for which to get the config.

Returns#

ManureHandlerConfig

The manure handler config for the given manure handler type name.

Raises#

KeyError

If the name of the manure handler type is not present in the available manure handler configs.

get_manure_separator_config(manure_separator_name: str) ManureSeparatorConfig | None#

Returns the config for the given manure separator name, or None if no separation is to occur.

Parameters#

manure_separator_namestr

The name of the manure separator type for which to get the config.

Returns#

Optional[ManureSeparatorConfig]

The manure separator config for the given manure separator type name, or None if the requested config is “none”.

Raises#

KeyError

If the specified manure separator config name is not present and is not “none”.

get_manure_treatment_config(manure_treatment_type_name: str) ManureTreatmentConfig#

Returns the manure treatment config for the given manure treatment type name.

Parameters#

manure_treatment_type_namestr

The name of the manure treatment type for which to get the config.

Returns#

ManureTreatmentConfig

The manure treatment config for the given manure treatment type name.

Raises#

KeyError

If the specified manure treatment config name is not present in the available manure treatment configs.

classmethod _process_bedding_configs(bedding_configs: List[Dict]) Dict[str, BeddingConfig]#

Creates a mapping of bedding configs to be used when setting up manure beddings.

Parameters#

bedding_configsList[Dict]

A list of dictionaries containing the bedding config information.

Returns#

Dict[str, BeddingConfig]

A dictionary of bedding config objects, with the key being the bedding name.

classmethod _process_manure_handler_configs(manure_handler_configs: List[Dict]) Dict[str, ManureHandlerConfig]#

Returns a dictionary of manure handler config objects, with the key being the name of the manure handler configuration option.

Parameters#

manure_handler_configsList[Dict]

A list of dictionaries containing the manure handler config information.

Returns#

Dict[str, ManureHandlerConfig]

A dictionary of manure handler config objects, with the key being the manure handler type.

Raises#

ValueError

If there are multiple configurations for one configuration name.

classmethod _process_manure_separator_configs(manure_separator_configs: list[dict[str, Any]]) Dict[str, ManureSeparatorConfig | None]#

Returns a dictionary of manure separator config objects, with the key being the name of the separator config.

Parameters#

manure_separator_configslist[dict[str, Any]]

A list of dictionaries containing the manure separator config information.

Returns#

Dict[ManureSeparatorType, ManureSeparatorConfig | None]

A dictionary of manure separator config objects, with the key being the manure separator type.

Raises#

ValueError

If there are multiple configurations for one configuration name.

classmethod _process_manure_treatment_configs(manure_treatment_configs: list[dict[str, Any]]) dict[str, ManureTreatmentConfig | tuple[ManureTreatmentConfig, ManureTreatmentConfig]]#

Returns a dictionary of manure treatment config objects, with the key being the manure treatment type.

Parameters#

manure_treatment_configslist[dict[str, Any]]

A list of dictionaries containing the manure treatment config information.

Returns#

dict[str, Union[ManureTreatmentConfig, Tuple[ManureTreatmentConfig, ManureTreatmentConfig]]]

A dictionary of manure treatment config objects, with the key being the manure treatment type.

Raises#

ValueError

If there are multiple configurations for one configuration name.

Notes#

There are two cases which require a combination of anaerobic digestion and anaerobic lagoon - anaerobic digestion and lagoon, and anaerobic digestion and lagoon with separation. In these cases, we return a tuple of two manure treatment configs, the first being the config for the digester and the second being the config for the lagoon. If a config is not provided for either the digester or the lagoon, then the simulation will crash if the user specified one of the digestion-lagoon combinations to be used.