flexmeasures.data.models.weather

Classes

class flexmeasures.data.models.weather.Weather(use_legacy_kwargs=True, **kwargs)

All weather measurements are stored in one slim table.

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
class flexmeasures.data.models.weather.WeatherSensor(**kwargs)

A weather sensor has a location on Earth and measures weather values of a certain weather sensor type, such as temperature, wind speed and irradiance.

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.

great_circle_distance(**kwargs)

Query great circle distance (unclear if in km or in miles).

Can be called with an object that has latitude and longitude properties, for example:

great_circle_distance(object=asset)

Can also be called with latitude and longitude parameters, for example:

great_circle_distance(latitude=32, longitude=54) great_circle_distance(lat=32, lng=54)

id
knowledge_horizon_fnc: str
knowledge_horizon_par: dict
name: str
timezone: str
unit: str
property weather_unit: float

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

class flexmeasures.data.models.weather.WeatherSensorType(**kwargs)

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.