flexmeasures.data.models.assets
Functions
Return True if all assets in this list are located on the same spot. TODO: In the future, we might soften this to compare if assets are in the same “housing” or “site”.
Classes
- class flexmeasures.data.models.assets.Asset(**kwargs)
Each asset is an energy- consuming or producing hardware.
This model is now considered legacy. See GenericAsset and Sensor.
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- get_attribute(attribute: str)
Looks for the attribute on the corresponding Sensor.
This should be used by all code to read these attributes, over accessing them directly on this class, as this table is in the process to be replaced by the Sensor table.
- id
- latest_state(event_ends_before: datetime | None = None) Power
Search the most recent event for this sensor, optionally before some datetime.
- class flexmeasures.data.models.assets.AssetType(**kwargs)
Describing asset types for our purposes
This model is now considered legacy. See GenericAssetType.
- __init__(**kwargs)
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- class flexmeasures.data.models.assets.Power(use_legacy_kwargs=True, **kwargs)
All measurements of power data are stored in one slim table. Negative values indicate consumption.
This model is now considered legacy. See TimedBelief.
- __init__(use_legacy_kwargs=True, **kwargs)
- data_source_id
- datetime
- horizon
- classmethod make_query(**kwargs) Query
Construct the database query.
- value