impacts
Module handling the computation of impacts from an electricity mix.
- ecodynelec.impacts.adapt_impacts(impact_data, mix, strategy='error')[source]
Adapt the mix data if there is a residual to consider.
- ecodynelec.impacts.compute_detailed_impacts(mix_data, impact_data, indicator)[source]
Computes the impacts of electricity per production unit for a given indicator.
- Parameters:
mix_data (pandas.DataFrame) – the electric mix data
impact_data (pandas.Series) – the vector of impacts per production unit for the impact indicator.
indicator (str) – name of the impact indicator
- Returns:
the impacts per production unit at each time step.
- Return type:
pandas.DataFrame
- ecodynelec.impacts.compute_global_impacts(mix_data, impact_data)[source]
Computes the overall impacts of electricity for each indicator
- Parameters:
mix_data (pandas.DataFrame) – the electric mix data
impact_data (pandas.DataFrame) – the table of impacts per production unit
- Returns:
the impacts for every impact indicator for each time step.
- Return type:
pandas.DataFrame
- ecodynelec.impacts.compute_impacts(mix_data, impact_data, strategy='error', is_verbose=False)[source]
Computes the impacts based on electric mix and production means impacts.
- Parameters:
mix_data (pandas.DataFrame) – information about the electric mix in the target country
impact_data (pandas.DataFrame) – impact matrix for all production units
is_verbose (bool, default to False) – to display information
- Returns:
dict of pandas DataFrame containing the impacts.
- Return type:
dict
- ecodynelec.impacts.equalize_impact_vector(impact_data, mix, strategy='error')[source]
Make sure the impact vector is aligned with the suggested production values.
- Parameters:
impact_data (pandas.DataFrame) – the table of impacts per production unit
mix (pandas.DataFrame) – the electric mix data, or production mix of all involved countries
strategy (str, default to ‘error’) – the strategy to follow when encountering producing units with no assocuated impact values. ‘error’ will raise an exception (default). ‘worst’ will fill with the most impactful coefficient in the matrix. ‘unit’ will fill with the most impactful coefficient of a same-typed unit from another country, and equals to ‘worst’ if no similar unit is found.
- Returns:
a new imact matrix with no missing value.
- Return type:
pandas.DataFrame