flexmeasures.data.models.assets

Functions

flexmeasures.data.models.assets.assets_share_location(assets: List[Asset]) bool

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.

property entity_address: str

Entity address under the latest fm scheme for entity addresses.

property entity_address_fm0: str

Entity address under the fm0 scheme for entity addresses.

event_resolution: timedelta
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
property is_pure_consumer: bool

Return True if this asset is consuming but not producing.

property is_pure_producer: bool

Return True if this asset is producing but not consuming.

knowledge_horizon_fnc: str
knowledge_horizon_par: dict
latest_state(event_ends_before: datetime | None = None) Power

Search the most recent event for this sensor, optionally before some datetime.

name: str
property power_unit: float

Return the ‘unit’ property of the generic asset, just with a more insightful name.

timezone: str
unit: str
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.

property preconditions: Dict[str, bool]

Assumptions about the time series data set, such as normality and stationarity For now, this is usable input for Prophet (see init), but it might evolve or go away.

property weather_correlations: List[str]

Known correlations of weather sensor type and asset type.

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