mescal.adapt_efficiency

Functions

_correct_esm_and_lca_efficiency_differences(...)

Correct the efficiency differences between ESM technologies and their operation LCI datasets. This method can be

_get_esm_input_quantity(→ float)

Retrieve a technology efficiency from the ESM model file

_get_esm_input_unit(→ str or None)

_get_lca_input_flow_unit_or_product(...)

Retrieve the unit or product of the removed flow (taken from the double counting removal report)

_get_lca_input_quantity(→ float)

Retrieve the quantity of the flow removed from the double counting removal report

Module Contents

mescal.adapt_efficiency._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[source]

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.

Parameters:
  • write_efficiency_report (bool) – if True, write the efficiency differences in a csv file

  • return_efficiency_report (bool) – if True, return the efficiency differences pandas DataFrame

  • db_type (str) – type of database to use for the efficiency correction, can be either ‘esm’, ‘esm results’ or ‘validation’

Returns:

None or pandas DataFrame if return_efficiency_report is True

Return type:

None or pd.DataFrame

mescal.adapt_efficiency._get_esm_input_quantity(self, row: pandas.Series) float[source]

Retrieve a technology efficiency from the ESM model file

Parameters:

row (pandas.Series) – series containing the name of the ESM technology and the name of the ESM flow to check for efficiency difference

Returns:

efficiency of the technology with respect to the given flow

Return type:

float

mescal.adapt_efficiency._get_esm_input_unit(self, row: pandas.Series) str or None[source]
Parameters:

row (pandas.Series)

Return type:

str or None

mescal.adapt_efficiency._get_lca_input_flow_unit_or_product(self, row: pandas.Series, output_type: str, removed_flows: pandas.DataFrame) list[str] | str | None[source]

Retrieve the unit or product of the removed flow (taken from the double counting removal report)

Parameters:
  • row (pandas.Series) – series containing the name of the ESM technology and the name of the ESM flow to check for efficiency difference

  • output_type (str) – can be either ‘unit’ or ‘product’

  • removed_flows (pandas.DataFrame) – dataframe containing the name and amount of removed flows during double counting removal

Returns:

the unit or product of the flow removed for the ESM (technology, flow) couple

Return type:

list[str] | str | None

mescal.adapt_efficiency._get_lca_input_quantity(self, row: pandas.Series, double_counting_removal_amount: pandas.DataFrame) float[source]

Retrieve the quantity of the flow removed from the double counting removal report

Parameters:
  • row (pandas.Series) – series containing the name of the ESM technology and the name of the ESM flow to check for efficiency difference

  • double_counting_removal_amount (pandas.DataFrame) – dataframe containing the scaled amounts removed during double counting removal

Returns:

quantity of the flow removed

Return type:

float

static mescal.adapt_efficiency._adapt_flows_to_efficiency_difference(act: dict, efficiency_ratio: float, techno_flows_to_correct: list[tuple[str, str]]) dict[source]

Adapt the biosphere flows of an activity to correct the efficiency difference between ESM and LCA

Parameters:
  • act (dict) – LCI dataset to adapt

  • efficiency_ratio (float) – ratio between the LCA and ESM efficiencies

  • techno_flows_to_correct (list[tuple[str, str]]) – list of (database, code) tuples to correct among the technosphere flows

Returns:

the adapted LCI dataset

Return type:

dict

static mescal.adapt_efficiency._basic_unit_conversion(row: pandas.Series) float or None[source]
Parameters:

row (pandas.Series)

Return type:

float or None