data
frequenz.lib.notebooks.reporting.asset_optimization.data ¤
Data fetching for asset optimization reporting.
Classes¤
Functions¤
frequenz.lib.notebooks.reporting.asset_optimization.data.fetch_data
async
¤
fetch_data(
mdata: MicrogridData,
*,
component_types: tuple[str],
mid: int,
start_time: datetime,
end_time: datetime,
resampling_period: timedelta,
splits: bool = False,
fetch_soc: bool = False
) -> DataFrame
Fetch data of a microgrid and processes it for plotting.
PARAMETER | DESCRIPTION |
---|---|
mdata
|
MicrogridData object to fetch data from.
TYPE:
|
component_types
|
List of component types to fetch data for. |
mid
|
Microgrid ID.
TYPE:
|
start_time
|
Start time for data fetching.
TYPE:
|
end_time
|
End time for data fetching.
TYPE:
|
resampling_period
|
Time resolution for data fetching.
TYPE:
|
splits
|
Whether to split the data into positive and negative parts.
TYPE:
|
fetch_soc
|
Whether to fetch state of charge (SOC) data.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
DataFrame
|
DataFrame containing the processed data. |
RAISES | DESCRIPTION |
---|---|
ValueError
|
If no data is found for the given microgrid and time range or if unexpected component types are present in the data. |
Source code in frequenz/lib/notebooks/reporting/asset_optimization/data.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
frequenz.lib.notebooks.reporting.asset_optimization.data.init_microgrid_data ¤
init_microgrid_data(
*,
microgrid_config_dir: str,
dotenv_path: str | None = None
) -> MicrogridData
Load MicrogridData instance using environment variables.
PARAMETER | DESCRIPTION |
---|---|
microgrid_config_dir
|
Directory containing microgrid configuration files.
TYPE:
|
dotenv_path
|
Optional path to an environment variable file.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
MicrogridData
|
MicrogridData instance. |