flexmeasures.data.schemas.scheduling.storage

Classes

class flexmeasures.data.schemas.scheduling.storage.EfficiencyField(*args, **kwargs)

Field that deserializes to a Quantity with % units. Must be greater than 0% and less than or equal to 100%.

Examples:

>>> ef = EfficiencyField()
>>> ef.deserialize(0.9)
<Quantity(90.0, 'percent')>
>>> ef.deserialize("90%")
<Quantity(90.0, 'percent')>
>>> ef.deserialize("0%")
Traceback (most recent call last):
...
marshmallow.exceptions.ValidationError: ['Must be greater than 0 and less than or equal to 1.']
__init__(*args, **kwargs)
class flexmeasures.data.schemas.scheduling.storage.StorageFlexModelSchema(start: datetime, sensor: Sensor, *args, **kwargs)

This schema lists fields we require when scheduling storage assets. Some fields are not required, as they might live on the Sensor.attributes. You can use StorageScheduler.deserialize_flex_config to get that filled in.

__init__(start: datetime, sensor: Sensor, *args, **kwargs)

Pass the schedule’s start, so we can use it to validate soc-target datetimes.

check_redundant_efficiencies(data: dict, **kwargs)
Check that none of the following cases occurs:
  1. flex-model contains both a round-trip efficiency and a charging efficiency

  2. flex-model contains both a round-trip efficiency and a discharging efficiency

  3. flex-model contains a round-trip efficiency, a charging efficiency and a discharging efficiency

Raise:

ValidationError

post_load_sequence(data: dict, **kwargs) dict

Perform some checks and corrections after we loaded.