appabuild.database.generator.eime#
Classes#
Information required to build serialized activities from Eime V6 exports. |
|
Generate yaml datasets readily usable by Appa Build from configuration file and |
|
Impact as generated by Eime V6 exports. |
|
Map EFV3 methods known by Appa Run with method names in Eime V6 exports. |
Module Contents#
- class appabuild.database.generator.eime.EimeV6DatasetDescription#
Bases:
pydantic.BaseModel
Information required to build serialized activities from Eime V6 exports.
- to_serialized_activity(exchanges: List[appabuild.database.serialized_data.SerializedExchange]) appabuild.database.serialized_data.SerializedActivity #
Convert to SerializedActivity. :param exchanges: list of SerializedExchange :return: SerializedActivity readily usable by Appa Build.
- amount: float | None = None#
- comment: str | None = None#
- data_quality: Dict[str, int] | None = None#
- database: str | None#
- include_in_tree: bool | None = False#
- location: str | None#
- name: str | None#
- name_in_export: str | None#
- type: str | None = None#
- unit: str | None#
- uuid: str | None#
- class appabuild.database.generator.eime.EimeV6Generator#
Generate yaml datasets readily usable by Appa Build from configuration file and Eime V6 impact exports. To generate the adequate export file, create a new Eime V6 project, add a single phase (no particular phase name required), and add a copy of every dataset you want to export. Then, go to analysis page, tick all required PEF impact assessment method, and export the result as a xlsx file. Configuration file should contain all other information of the datasets you want to generate. Common fields across all datasets can be set once in a “default” dict. Specific fields can be provided as a list in a “datasets” dict. Each dataset should have a “name_in_export” key, which value is the name of the corresponding dataset in Eime V6 export.
- generate_datasets(eime_v6_impacts_export_path: str, datasets_description: dict) List[appabuild.database.serialized_data.SerializedActivity] #
Generate yaml datasets readily usable by Appa Build.
- Parameters:
eime_v6_impacts_export_path – Eime V6 impact exports. To generate the
adequate export file, create a new Eime V6 project, add a single phase (no particular phase name required), and add a copy of every dataset you want to export. Then, go to analysis page, tick all required PEF impact assessment method, and export the result as a xlsx file. :param datasets_description: should contain all other information of the datasets you want to generate. Common fields across all datasets can be set once in a “default” dict. Specific fields can be provided as a list in a “datasets” dict. Each dataset should have a “name_in_export” key, which value is the name of the corresponding dataset in Eime V6 export. :return: list of SerializedActivity readily usable by Appa Build.
- parse_impacts_export(eime_v6_impacts_export_path: str) List[EimeV6Impact] #
Parse Eime V6 export to find every impact, with corresponding Eime V6 impact method name and dataset name. :param eime_v6_impacts_export_path: path to the export file exported by Eime V6. :return: a list of EimeV6impact present in the export file.
- save_datasets(datasets: List[appabuild.database.serialized_data.SerializedActivity], output_path: str)#
Export SerializedActivity generated to yaml files. :param datasets: SerialiazedActivity datasets to save :param output_path: directory to save yaml files. :return:
- impacts: List[EimeV6Impact] = []#
- class appabuild.database.generator.eime.EimeV6Impact#
Bases:
pydantic.BaseModel
Impact as generated by Eime V6 exports.
- get_method_full_name() apparun.impact_methods.MethodFullName #
Convert Eime V6 export method name to Appa Run method name. :return: Method name known by Appa Run.
- to_serialized_exchange(database: str) appabuild.database.serialized_data.SerializedExchange #
Transforms the impact to a SerializedExchange. Each impact will be linked to a impact proxy exchange. And impact proxy is an elementary flow with a characterisation factor of 1 to the corresponding impact method. Impact proxies and corresponding characterisation factors are automatically generated at Appa Build start up. :param database: name of the user database the exchange will be attached to. Likely the database name of the calling Activity. :return: SerializedExchange readily usable by Appa Build.
- amount: float#
Amount of impact.
- impact_name: str#
Method name in Eime V6 export.
- name_in_export: str#
Name of the dataset in Eime V6 export.
- class appabuild.database.generator.eime.MethodEimeV6Name#
Bases:
str
,enum.Enum
Map EFV3 methods known by Appa Run with method names in Eime V6 exports.
Initialize self. See help(type(self)) for accurate signature.
- EFV3_ACIDIFICATION = 'PEF-AP'#
- EFV3_CLIMATE_CHANGE = 'PEF-GWP'#
- EFV3_CLIMATE_CHANGE_BIOGENIC = 'PEF-GWPb'#
- EFV3_CLIMATE_CHANGE_FOSSIL = 'PEF-GWPf'#
- EFV3_CLIMATE_CHANGE_LAND_USE = 'PEF-GWPlu'#
- EFV3_ECOTOXICITY_FRESHWATER = 'PEF-CTUe'#
- EFV3_ENERGY_RESOURCES = 'PEF-ADPf'#
- EFV3_EUTROPHICATION_FRESHWATER = 'PEF-Epf'#
- EFV3_EUTROPHICATION_MARINE = 'PEF-Epm'#
- EFV3_EUTROPHICATION_TERRESTRIAL = 'PEF-Ept'#
- EFV3_HUMAN_TOXICITY_CARCINOGENIC = 'PEF-CTUh-c'#
- EFV3_HUMAN_TOXICITY_NON_CARCINOGENIC = 'PEF-CTUh-nc'#
- EFV3_IONISING_RADIATION = 'PEF-IR'#
- EFV3_LAND_USE = 'PEF-LU'#
- EFV3_MATERIAL_RESOURCES = 'PEF-ADPe'#
- EFV3_OZONE_DEPLETION = 'PEF-ODP'#
- EFV3_PARTICULATE_MATTER_FORMATION = 'PEF-PM'#
- EFV3_PHOTOCHEMICAL_OZONE_FORMATION = 'PEF-POCP'#
- EFV3_WATER_USE = 'PEF-WU'#