mescal.adapt_efficiency ======================= .. py:module:: mescal.adapt_efficiency Functions --------- .. autoapisummary:: mescal.adapt_efficiency._correct_esm_and_lca_efficiency_differences mescal.adapt_efficiency._get_esm_input_quantity mescal.adapt_efficiency._get_esm_input_unit mescal.adapt_efficiency._get_lca_input_flow_unit_or_product mescal.adapt_efficiency._get_lca_input_quantity Module Contents --------------- .. py:function:: _correct_esm_and_lca_efficiency_differences(self, return_efficiency_report: bool = False, write_efficiency_report: bool = True, db_type: str = 'esm') -> None or pd.DataFrame Correct the efficiency differences between ESM technologies and their operation LCI datasets. This method can be used during the creation of the ESM database and during the creation of the ESM results database. :param write_efficiency_report: if True, write the efficiency differences in a csv file :param return_efficiency_report: if True, return the efficiency differences pandas DataFrame :param db_type: type of database to use for the efficiency correction, can be either 'esm', 'esm results' or 'validation' :return: None or pandas DataFrame if return_efficiency_report is True .. py:function:: _get_esm_input_quantity(self, row: pandas.Series) -> float Retrieve a technology efficiency from the ESM model file :param row: series containing the name of the ESM technology and the name of the ESM flow to check for efficiency difference :return: efficiency of the technology with respect to the given flow .. py:function:: _get_esm_input_unit(self, row: pandas.Series) -> str or None .. py:function:: _get_lca_input_flow_unit_or_product(self, row: pandas.Series, output_type: str, removed_flows: pandas.DataFrame) -> list[str] | str | None Retrieve the unit or product of the removed flow (taken from the double counting removal report) :param row: series containing the name of the ESM technology and the name of the ESM flow to check for efficiency difference :param output_type: can be either 'unit' or 'product' :param removed_flows: dataframe containing the name and amount of removed flows during double counting removal :return: the unit or product of the flow removed for the ESM (technology, flow) couple .. py:function:: _get_lca_input_quantity(self, row: pandas.Series, double_counting_removal_amount: pandas.DataFrame) -> float Retrieve the quantity of the flow removed from the double counting removal report :param row: series containing the name of the ESM technology and the name of the ESM flow to check for efficiency difference :param double_counting_removal_amount: dataframe containing the scaled amounts removed during double counting removal :return: quantity of the flow removed .. py:method:: _adapt_flows_to_efficiency_difference(act: dict, efficiency_ratio: float, techno_flows_to_correct: list[tuple[str, str]]) -> dict :staticmethod: Adapt the biosphere flows of an activity to correct the efficiency difference between ESM and LCA :param act: LCI dataset to adapt :param efficiency_ratio: ratio between the LCA and ESM efficiencies :param techno_flows_to_correct: list of (database, code) tuples to correct among the technosphere flows :return: the adapted LCI dataset .. py:method:: _basic_unit_conversion(row: pandas.Series) -> float or None :staticmethod: