flexmeasures.data.queries.portfolio

Functions

flexmeasures.data.queries.portfolio.get_power_data(resource_dict: Dict[str, Resource]) Tuple[Dict[str, DataFrame], Dict[str, DataFrame], Dict[str, float], Dict[str, float], Dict[str, float], Dict[str, float]]

Get power data, separating demand and supply, as time series per resource and as totals (summed over time) per resource and per asset.

Getting sensor data of a Resource leads to database queries (unless results are already cached).

Returns:

a tuple comprising: - a dictionary of resource names (as keys) and a DataFrame with aggregated time series of supply (as values) - a dictionary of resource names (as keys) and a DataFrame with aggregated time series of demand (as values) - a dictionary of resource names (as keys) and their total supply summed over time (as values) - a dictionary of resource names (as keys) and their total demand summed over time (as values) - a dictionary of asset names (as keys) and their total supply summed over time (as values) - a dictionary of asset names (as keys) and their total demand summed over time (as values)

flexmeasures.data.queries.portfolio.get_price_data(resource_dict: Dict[str, Resource]) Tuple[Dict[str, BeliefsDataFrame], Dict[str, float]]
flexmeasures.data.queries.portfolio.get_structure(assets: List[Asset]) Tuple[Dict[str, AssetType], List[Market], Dict[str, Resource]]

Get asset portfolio structured as Resources, based on AssetTypes present in a list of Assets.

Initializing Resources leads to some database queries.

Parameters:

assets – a list of Assets

Returns:

a tuple comprising: - a dictionary of resource names (as keys) and the asset type represented by these resources (as values) - a list of (unique) Markets that are relevant to these resources - a dictionary of resource names (as keys) and Resources (as values)