mescal.change_ecoinvent ======================= .. py:module:: mescal.change_ecoinvent Functions --------- .. autoapisummary:: mescal.change_ecoinvent.change_database_name_in_mapping_file mescal.change_ecoinvent.change_ecoinvent_version_mapping mescal.change_ecoinvent.concatenate_change_reports mescal.change_ecoinvent.handle_multi_processes_ecoinvent mescal.change_ecoinvent.load_change_report_annex mescal.change_ecoinvent.load_concatenated_ecoinvent_change_report mescal.change_ecoinvent.update_mapping_file mescal.change_ecoinvent.update_unit_conversion_file Module Contents --------------- .. py:function:: change_database_name_in_mapping_file(row: pandas.Series, version_from: str, version_to: str, name_complementary_db: str = None) -> pandas.Series Change the name of the database in the mapping file :param row: row of the mapping file :param version_from: initial version of the ecoinvent database :param version_to: target version of the ecoinvent database :param name_complementary_db: name of the complementary database :return: updated row .. py:function:: change_ecoinvent_version_mapping(mapping: pandas.DataFrame, v_from: str, v_to: str, name_complementary_db: str = None) -> tuple[pandas.DataFrame, [tuple[str, str], tuple[str, str, str], str, str]] Change the version of the ecoinvent database in the mapping file :param mapping: mapping between the LCI datasets and the ESM technologies :param v_from: initial version of the ecoinvent database :param v_to: target version of the ecoinvent database :param name_complementary_db: name of the complementary database :return: updated mapping, list of tuples with unit changes .. py:function:: concatenate_change_reports(v_from: str, v_to: str) -> pandas.DataFrame Concatenate change reports annexes of the ecoinvent database :param v_from: initial version of the ecoinvent database :param v_to: final version of the ecoinvent database :return: concatenated change report annex as a pandas DataFrame .. py:function:: handle_multi_processes_ecoinvent(df: pandas.DataFrame) -> pandas.DataFrame Handle multi-processes activities in the ecoinvent change report annex :param df: dataframe of the concatenated change report annex :return: updated dataframe with multi-processes activities separated .. py:function:: load_change_report_annex(v_from: str, v_to: str) -> pandas.DataFrame Load the change report annex between two versions of the ecoinvent database :param v_from: initial version of the ecoinvent database :param v_to: next version of the ecoinvent database :return: change report annex as a pandas DataFrame .. py:function:: load_concatenated_ecoinvent_change_report(v_from: str, v_to: str) -> pandas.DataFrame Load the concatenated change report between two versions of the ecoinvent database :param v_from: initial version of the ecoinvent database :param v_to: next version of the ecoinvent database :return: concatenated change report as a pandas DataFrame .. py:function:: update_mapping_file(mapping: pandas.DataFrame, change_report: pandas.DataFrame, unit_to_change: list = None) -> tuple[pandas.DataFrame, int, [tuple[str, str], tuple[str, str, str], str, str]] Update the mapping file with the concatenated change report :param mapping: mapping between the LCI datasets and the ESM technologies :param change_report: concatenated change report between two versions of the ecoinvent database :param unit_to_change: list of tuples in case a unit change has been detected :return: updated mapping, number of changes, list of tuples with unit changes .. py:function:: update_unit_conversion_file(unit_conversion: pandas.DataFrame, unit_changes: list, new_unit_conversion_factors: dict) -> pandas.DataFrame Adapt the unit conversion file according to the possible unit changes in the mapping file :param unit_conversion: file with unit conversion factors :param unit_changes: list of tuples with unit changes :param new_unit_conversion_factors: dictionary with new unit conversion factors :return: updated unit conversion file