checking

exception ecodynelec.checking.IncompleteError(message)[source]

Bases: ValueError

Error if NaNs are found in the mapping

exception ecodynelec.checking.IncompleteWarning(message)[source]

Bases: UserWarning

Warning if NaNs are found in the mapping

exception ecodynelec.checking.MissingError(message='')[source]

Bases: ValueError

Error if units are missing in the mapping

exception ecodynelec.checking.MissingWarning(message)[source]

Bases: UserWarning

Warning if units are missing in the mapping

ecodynelec.checking.check_frequency(freq)[source]

Verifies if the requested frequency is supported

Parameters:

freq (str) – the frequency to test

Raises:

KeyError – Error if the frequency is no allowed.

ecodynelec.checking.check_mapping(mapping, mix, strategy='error')[source]

Verifies if a producing unit has no associated impacts. Depending on the strategy, an error or a warning is raised.

Parameters:
  • mapping (pandas.DataFrame) – the table of impacts

  • mix (pandas.DataFrame) – the table containing electricity mix. Valid before and after electricity tracking.

  • strategy (str, default to ‘error’) – the way to treat missing impacts for producing units.

Raises:

ValueError – if the strategy is ‘raise’ or ‘error’, a missing value raises a ValueError.

ecodynelec.checking.check_regularity_frequency(freq)[source]

Verifies if the requested frequency is regular for pandas. The set of accepted frequencies is smaller in pandas, up to weeks.

Parameters:

freq (str) – the frequency to test

Returns:

True if the frequency is valid for Pandas, false otherwise.

Return type:

bool

ecodynelec.checking.check_residual_availability(prod, residual, freq='H')[source]

Verifies if the residual information are available for the whole duration.

Parameters:
  • prod (pandas.DataFrame) – the production data where to add the residual

  • residual (pandas.DataFrame) – the residual data to check the availability of.

  • freq (str, default to ‘H’) – the frequency to consider

Returns:

True, if no exception is raised.

Return type:

bool

Raises:

IndexError