isp-trace-parser 1.0.3__tar.gz → 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {isp_trace_parser-1.0.3/src/isp_trace_parser.egg-info → isp_trace_parser-2.0.0}/PKG-INFO +282 -254
- isp_trace_parser-1.0.3/PKG-INFO → isp_trace_parser-2.0.0/README.md +278 -266
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/pyproject.toml +6 -3
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_name_mapping_configs/solar_project_mapping.yaml +1 -1
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser/demand_traces.py +57 -47
- isp_trace_parser-2.0.0/src/isp_trace_parser/get_data.py +1362 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser/metadata_extractors.py +6 -5
- isp_trace_parser-2.0.0/src/isp_trace_parser/optimise_parquet.py +95 -0
- isp_trace_parser-2.0.0/src/isp_trace_parser/remote/__init__.py +5 -0
- isp_trace_parser-2.0.0/src/isp_trace_parser/remote/download.py +233 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser/solar_traces.py +66 -79
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser/trace_formatter.py +10 -10
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser/trace_restructure_helper_functions.py +18 -27
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser/wind_traces.py +77 -91
- isp_trace_parser-1.0.3/README.md → isp_trace_parser-2.0.0/src/isp_trace_parser.egg-info/PKG-INFO +294 -252
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser.egg-info/SOURCES.txt +9 -3
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser.egg-info/requires.txt +2 -0
- isp_trace_parser-2.0.0/tests/test_download.py +140 -0
- isp_trace_parser-2.0.0/tests/test_get_data.py +425 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/tests/test_input_validation.py +15 -12
- isp_trace_parser-2.0.0/tests/test_optimise_parquet.py +37 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/tests/test_trace_file_meta_data_extraction.py +8 -6
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/tests/test_trace_formatter.py +6 -6
- isp_trace_parser-2.0.0/tests/test_trace_parsers.py +78 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/tests/test_writing_save_names.py +21 -23
- isp_trace_parser-1.0.3/src/isp_trace_parser/get_data.py +0 -861
- isp_trace_parser-1.0.3/tests/test_directory_restructure.py +0 -131
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/LICENSE +0 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/setup.cfg +0 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_name_mapping_configs/demand_scenario_mapping.yaml +0 -0
- /isp_trace_parser-1.0.3/src/isp_trace_name_mapping_configs/solar_area_mapping.yaml → /isp_trace_parser-2.0.0/src/isp_trace_name_mapping_configs/solar_zone_mapping.yaml +0 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_name_mapping_configs/wind_project_mapping.yaml +0 -0
- /isp_trace_parser-1.0.3/src/isp_trace_name_mapping_configs/wind_area_mapping.yaml → /isp_trace_parser-2.0.0/src/isp_trace_name_mapping_configs/wind_zone_mapping.yaml +0 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser/__init__.py +0 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser/construct_reference_year_mapping.py +0 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser/input_validation.py +0 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser.egg-info/dependency_links.txt +0 -0
- {isp_trace_parser-1.0.3 → isp_trace_parser-2.0.0}/src/isp_trace_parser.egg-info/top_level.txt +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: isp-trace-parser
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: A Python package for reformatting and accessing demand, solar, and wind time series data used by the
|
|
5
|
-
Author-email: nick-gorman <n.gorman305@gmail.com>,
|
|
5
|
+
Author-email: nick-gorman <n.gorman305@gmail.com>, dylanjmcconnell <dylan.mcconnell@unsw.edu.au>, prakaa <abiprakash007@gmail.com>
|
|
6
6
|
Requires-Python: >=3.9
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENSE
|
|
@@ -10,6 +10,8 @@ Requires-Dist: polars>=1.7.1
|
|
|
10
10
|
Requires-Dist: pandas>=2.2.2
|
|
11
11
|
Requires-Dist: pydantic>=2.9.2
|
|
12
12
|
Requires-Dist: joblib>=1.4.2
|
|
13
|
+
Requires-Dist: duckdb>=1.4.2
|
|
14
|
+
Requires-Dist: tqdm>=4.67.1
|
|
13
15
|
Dynamic: license-file
|
|
14
16
|
|
|
15
17
|
# AEMO Integrated System Plan Trace Parser
|
|
@@ -26,7 +28,11 @@ Market Operator (AEMO) in their Integrated System Plan (ISP) modelling study.
|
|
|
26
28
|
> [!IMPORTANT]
|
|
27
29
|
> Currently, `isp-trace-parser` only supports trace data in the format of the 2024 ISP.
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
> [!WARNING]
|
|
32
|
+
> **Version 2.0 breaking change:** Version 2.0 of `isp-trace-parser` stores and reads parsed data in a new hive-partitioned storage format. Data originally parsed with version 1.x is **not compatible** with version 2.0.
|
|
33
|
+
While the original API itself remains largely the same, upgrading from version 1.x requires either [re-parsing your raw AEMO trace data](#parsing-trace-data) or [downloading pre-processed data](#pre-processed-trace-data).
|
|
34
|
+
|
|
35
|
+
## Table of contents
|
|
30
36
|
|
|
31
37
|
- [Install](#install)
|
|
32
38
|
- [How the package works](#how-the-package-works)
|
|
@@ -34,8 +40,8 @@ Market Operator (AEMO) in their Integrated System Plan (ISP) modelling study.
|
|
|
34
40
|
- [Key terminology](#key-terminology)
|
|
35
41
|
- [Examples](#examples)
|
|
36
42
|
- [Parsing trace data](#parsing-trace-data)
|
|
37
|
-
- [Querying parsed trace data](#querying-parsed-trace-data)
|
|
38
|
-
- [Querying trace data for
|
|
43
|
+
- [Querying parsed trace data using alternative approach](#querying-parsed-trace-data-using-alternative-approach)
|
|
44
|
+
- [Querying trace data for sets of projects, zones or subregions](#querying-trace-data-for-sets-of-projects-zones-or-subregions)
|
|
39
45
|
- [Constructing reference year mapping](#constructing-reference-year-mapping)
|
|
40
46
|
- [Dataframe trace parsing](#dataframe-trace-parsing)
|
|
41
47
|
- [Contributing](#contributing)
|
|
@@ -52,8 +58,8 @@ pip install isp-trace-parser
|
|
|
52
58
|
1. Parse raw AEMO trace data using the functions `parse_wind_traces`, `parse_solar_traces`, and
|
|
53
59
|
`parse_demand_traces`.
|
|
54
60
|
- These functions reformat and restructure the data to a specified directory.
|
|
55
|
-
- *Reformatting* puts the data in a standard time series format (i.e. with a `
|
|
56
|
-
- The data is *restructured* into
|
|
61
|
+
- *Reformatting* puts the data in a standard time series format (i.e. with a `datetime` column and `value` column).
|
|
62
|
+
- The data is *restructured* into [Parquet](https://parquet.apache.org/) files, which significantly improves the speed at which data can be read from disk.
|
|
57
63
|
- To access the full documentation for these functions, you can run `help` in the Python console, e.g. `help(parse_wind_traces)`.
|
|
58
64
|
|
|
59
65
|
2. Query the parsed data using the naming conventions for generators, renewable energy zones (REZs), and subregions established in the
|
|
@@ -62,26 +68,73 @@ pip install isp-trace-parser
|
|
|
62
68
|
- To access the full documentation for these functions, you can run `help` in the Python console, e.g.
|
|
63
69
|
`help(get_data.solar_project_trace_single_reference_year)`.
|
|
64
70
|
|
|
65
|
-
## Accessing
|
|
71
|
+
## Accessing trace data
|
|
66
72
|
|
|
73
|
+
### Original trace data
|
|
67
74
|
Currently, AEMO trace data needs to be downloaded from the [AEMO website](https://aemo.com.au/en/energy-systems/major-publications/integrated-system-plan-isp/2024-integrated-system-plan-isp)
|
|
68
75
|
and unzipped manually before the trace parser can be used.
|
|
69
76
|
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
The zipped data is also archived in publicly accessible object storage ([data.openisp.au](https://data.openisp.au)). This can be downloaded by:
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
from isp_trace_parser.remote import fetch_trace_data
|
|
81
|
+
|
|
82
|
+
fetch_trace_data("full", dataset_src="isp_2024", save_directory="data/archive", data_format="archive")
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
This will download all the archived zip files into the provided directory with the following structure:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
archive/
|
|
89
|
+
└── isp_2024/
|
|
90
|
+
├── solar/
|
|
91
|
+
├── wind/
|
|
92
|
+
└── demand/
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Pre-processed trace data
|
|
96
|
+
|
|
97
|
+
Trace data that has been processed into the hive-partitioned format is also available for download from the object store. Both "full" and "example" datasets are available (the example dataset contains only data for the 2018 reference year):
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
from isp_trace_parser.remote import fetch_trace_data
|
|
101
|
+
|
|
102
|
+
# Download example dataset (2018 reference year only)
|
|
103
|
+
fetch_trace_data("example", dataset_src="isp_2024", save_directory="data/trace_data", data_format="processed")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
This will download the processed parquet files with the following structure:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
trace_data/
|
|
110
|
+
├── project/
|
|
111
|
+
│ └── reference_year=<year>/
|
|
112
|
+
├── zone/
|
|
113
|
+
│ └── reference_year=<year>/
|
|
114
|
+
└── demand/
|
|
115
|
+
└── scenario=<scenario_name>/
|
|
116
|
+
└── reference_year=<year>/
|
|
117
|
+
```
|
|
72
118
|
|
|
73
119
|
## Key terminology
|
|
74
120
|
|
|
75
121
|
### Solar/wind
|
|
76
122
|
|
|
77
123
|
- _**Project**_: Traces for a specific solar/wind project
|
|
78
|
-
- _**
|
|
124
|
+
- _**Zone**_: Traces for a zone, e.g. a renewable energy zone
|
|
79
125
|
- _**Reference year**_: A historical weather year that is used to produce the generation trace.
|
|
80
126
|
- Modelled years are mapped to reference years, e.g. generation data for one or multiple years can be mapped to a single reference year, or generation data for each year can be mapped to different reference years (refer to the [Querying parsed trace data example](https://github.com/Open-ISP/isp-trace-parser#querying-parsed-trace-data)).
|
|
81
|
-
- _**
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
127
|
+
- _**Resource type**_ : This is used to categorise types of resource data:
|
|
128
|
+
- Solar:
|
|
129
|
+
- FFP: fixed flat plate
|
|
130
|
+
- SAT: single-axis tracking.
|
|
131
|
+
- CST: concentrated solar thermal
|
|
132
|
+
- Wind:
|
|
133
|
+
- WH: onshore wind (high)
|
|
134
|
+
- WL: onshore wind (low)
|
|
135
|
+
- WFX: offshore wind (fixed)
|
|
136
|
+
- WFL: offshore wind (floating)
|
|
137
|
+
- WIND: (existing project)
|
|
85
138
|
|
|
86
139
|
### Demand
|
|
87
140
|
- _**Reference year**_: A historical weather year that is used to produce the demand trace.
|
|
@@ -99,31 +152,10 @@ If AEMO trace data is downloaded onto a local machine, it can be reformatted usi
|
|
|
99
152
|
|
|
100
153
|
To perform the reformatting and restructuring, the solar, wind and demand data should each be stored in separate directories (though no exact directory structure within the solar, wind and demand subdirectories needs to be followed).
|
|
101
154
|
|
|
102
|
-
The following code can then be used to parse the data
|
|
155
|
+
The following code can then be used to parse out the `project`, `zone` or `demand` data, by making use of appropriate filters.
|
|
103
156
|
|
|
104
157
|
### Parsing all files in a directory
|
|
105
158
|
|
|
106
|
-
```python
|
|
107
|
-
from isp_trace_parser import parse_solar_traces, parse_wind_traces, parse_demand_traces
|
|
108
|
-
|
|
109
|
-
parse_solar_traces(
|
|
110
|
-
input_directory='<path/to/aemo/solar/traces>',
|
|
111
|
-
parsed_directory='<path/to/store/solar/output>',
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
parse_wind_traces(
|
|
115
|
-
input_directory='<path/to/aemo/wind/traces>',
|
|
116
|
-
parsed_directory='<path/to/store/wind/output>',
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
parse_demand_traces(
|
|
120
|
-
input_directory='<path/to/aemo/demand/traces>',
|
|
121
|
-
parsed_directory='<path/to/store/demand/output>',
|
|
122
|
-
)
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Filtering which files get parsed
|
|
126
|
-
|
|
127
159
|
```python
|
|
128
160
|
from isp_trace_parser import (
|
|
129
161
|
parse_solar_traces,
|
|
@@ -136,179 +168,62 @@ from isp_trace_parser import (
|
|
|
136
168
|
|
|
137
169
|
# Note: to not filter on a component of the metadata it can be excluded from the filter definition.
|
|
138
170
|
|
|
139
|
-
|
|
140
|
-
name=['N1'],
|
|
141
|
-
file_type=['area'],
|
|
142
|
-
technology=['SAT'],
|
|
143
|
-
reference_year=[2011]
|
|
144
|
-
)
|
|
145
|
-
|
|
171
|
+
filters = SolarMetadataFilter(file_type=["project"])
|
|
146
172
|
parse_solar_traces(
|
|
147
173
|
input_directory='<path/to/aemo/solar/traces>',
|
|
148
|
-
parsed_directory='<path/to/store/
|
|
149
|
-
filters=
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
wind_filters = WindMetadataFilter(
|
|
153
|
-
name=['N1'],
|
|
154
|
-
file_type=['area'],
|
|
155
|
-
resouce_quality=['WH'],
|
|
156
|
-
reference_year=[2011]
|
|
174
|
+
parsed_directory='<path/to/store/project>',
|
|
175
|
+
filters = filters,
|
|
157
176
|
)
|
|
158
177
|
|
|
178
|
+
filters = WindMetadataFilter(file_type=["project"])
|
|
159
179
|
parse_wind_traces(
|
|
160
180
|
input_directory='<path/to/aemo/wind/traces>',
|
|
161
|
-
parsed_directory='<path/to/store/
|
|
162
|
-
filters=
|
|
163
|
-
)
|
|
164
|
-
|
|
165
|
-
demand_filters = DemandMetadataFilter(
|
|
166
|
-
scenario=['Green Energy Exports'],
|
|
167
|
-
subregion=['CNSW'],
|
|
168
|
-
poe=['POE50'],
|
|
169
|
-
demand_type=['OPSO_MODELLING'],
|
|
170
|
-
reference_year=[2011]
|
|
171
|
-
)
|
|
172
|
-
|
|
173
|
-
parse_demand_traces(
|
|
174
|
-
input_directory='<path/to/aemo/demand/traces>',
|
|
175
|
-
parsed_directory='<path/to/store/demand/output>',
|
|
176
|
-
filters=demand_filters
|
|
177
|
-
)
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Querying parsed trace data
|
|
181
|
-
|
|
182
|
-
Once trace data has been parsed it can be queried using the following API functionality.
|
|
183
|
-
|
|
184
|
-
<details>
|
|
185
|
-
<summary>Solar project traces from 2022 to 2024 (for a single reference year), and for 2022 and 2024 (multiple reference years)</summary>
|
|
186
|
-
<br>
|
|
187
|
-
|
|
188
|
-
```python
|
|
189
|
-
from isp_trace_parser import get_data
|
|
190
|
-
|
|
191
|
-
solar_project_trace_single_reference_year = get_data.solar_project_single_reference_year(
|
|
192
|
-
start_year=2022,
|
|
193
|
-
end_year=2024,
|
|
194
|
-
reference_year=2011,
|
|
195
|
-
project='Adelaide Desalination Plant Solar Farm',
|
|
196
|
-
directory='example_parsed_data/solar'
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
solar_project_trace_many_reference_years = get_data.solar_project_multiple_reference_years(
|
|
200
|
-
reference_years={2022: 2011, 2024: 2012},
|
|
201
|
-
project='Adelaide Desalination Plant Solar Farm',
|
|
202
|
-
directory='example_parsed_data/solar'
|
|
181
|
+
parsed_directory='<path/to/store/project>',
|
|
182
|
+
filters = filters,
|
|
203
183
|
)
|
|
204
|
-
```
|
|
205
184
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<
|
|
209
|
-
<
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
```python
|
|
213
|
-
from isp_trace_parser import get_data
|
|
214
|
-
solar_rez_trace_single_reference_years = get_data.solar_area_single_reference_year(
|
|
215
|
-
start_year=2022,
|
|
216
|
-
end_year=2024,
|
|
217
|
-
reference_year=2011,
|
|
218
|
-
area='Q1',
|
|
219
|
-
technology='SAT',
|
|
220
|
-
directory='example_parsed_data/solar'
|
|
221
|
-
)
|
|
222
|
-
|
|
223
|
-
solar_rez_trace_many_reference_years = get_data.solar_area_multiple_reference_years(
|
|
224
|
-
reference_years={2022: 2011, 2024: 2012},
|
|
225
|
-
area='Q1',
|
|
226
|
-
technology='SAT',
|
|
227
|
-
directory='example_parsed_data/solar'
|
|
228
|
-
)
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
</details>
|
|
232
|
-
|
|
233
|
-
<details>
|
|
234
|
-
<summary>Wind project traces from 2022 to 2024 (for a single reference year), and for 2022 and 2024 (multiple reference years)</summary>
|
|
235
|
-
<br>
|
|
236
|
-
|
|
237
|
-
```python
|
|
238
|
-
from isp_trace_parser import get_data
|
|
239
|
-
wind_project_trace_single_reference_years = get_data.wind_project_single_reference_year(
|
|
240
|
-
start_year=2022,
|
|
241
|
-
end_year=2024,
|
|
242
|
-
reference_year=2011,
|
|
243
|
-
project='Bango 973 Wind Farm',
|
|
244
|
-
directory='example_parsed_data/wind'
|
|
245
|
-
)
|
|
246
|
-
|
|
247
|
-
wind_project_trace_many_reference_years = get_data.wind_project_multiple_reference_years(
|
|
248
|
-
reference_years={2022: 2011, 2024: 2012},
|
|
249
|
-
project='Bango 973 Wind Farm',
|
|
250
|
-
directory='example_parsed_data/wind'
|
|
185
|
+
filters = SolarMetadataFilter(file_type=["zone"])
|
|
186
|
+
parse_solar_traces(
|
|
187
|
+
input_directory='<path/to/aemo/solar/traces>',
|
|
188
|
+
parsed_directory='<path/to/store/zone>',
|
|
189
|
+
filters = filters,
|
|
251
190
|
)
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
</details>
|
|
255
|
-
|
|
256
|
-
<details>
|
|
257
|
-
<summary>Wind area/REZ traces from 2022 to 2024 (for a single reference year), and for 2022 and 2024 (multiple reference years)</summary>
|
|
258
|
-
<br>
|
|
259
191
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
reference_year=2011,
|
|
266
|
-
area='Q1',
|
|
267
|
-
resource_quality='WH',
|
|
268
|
-
directory='example_parsed_data/wind'
|
|
192
|
+
filters = WindMetadataFilter(file_type=["zone"])
|
|
193
|
+
parse_wind_traces(
|
|
194
|
+
input_directory='<path/to/aemo/wind/traces>',
|
|
195
|
+
parsed_directory='<path/to/store/zone>',
|
|
196
|
+
filters = filters,
|
|
269
197
|
)
|
|
270
198
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
resource_quality='WH',
|
|
275
|
-
directory='example_parsed_data/wind'
|
|
199
|
+
parse_demand_traces(
|
|
200
|
+
input_directory='<path/to/aemo/demand/traces>',
|
|
201
|
+
parsed_directory='<path/to/store/demand>',
|
|
276
202
|
)
|
|
277
203
|
```
|
|
278
204
|
|
|
279
|
-
|
|
205
|
+
### Optimising stored data
|
|
206
|
+
The following code illustrates how the parsed parquet files can be consolidated and optimised with `optimise_parquet.py`
|
|
280
207
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
<br>
|
|
208
|
+
> [!NOTE]
|
|
209
|
+
> There _may_ be an issue with this step on some architectures (see issue https://github.com/Open-ISP/isp-trace-parser/issues/23).
|
|
284
210
|
|
|
285
211
|
```python
|
|
286
|
-
from isp_trace_parser import
|
|
287
|
-
demand_subregion_trace_single_reference_years = get_data.demand_single_reference_year(
|
|
288
|
-
start_year=2024,
|
|
289
|
-
end_year=2024,
|
|
290
|
-
reference_year=2011,
|
|
291
|
-
subregion='CNSW',
|
|
292
|
-
scenario='Green Energy Exports',
|
|
293
|
-
poe='POE10',
|
|
294
|
-
demand_type='OPSO_MODELLING',
|
|
295
|
-
directory='example_parsed_data/demand'
|
|
296
|
-
)
|
|
212
|
+
from isp_trace_parser import optimise_parquet
|
|
297
213
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
poe='POE10',
|
|
303
|
-
demand_type='OPSO_MODELLING',
|
|
304
|
-
directory='example_parsed_data/demand'
|
|
305
|
-
)
|
|
214
|
+
# For optimising `zone` and `project`, suggest partitioning on reference year
|
|
215
|
+
optimise_parquet.partition_traces_by_columns(input_directory="<path/to/store/zone|project>",
|
|
216
|
+
output_directory="<path/to/store/optimised_zone|optimised_project>",
|
|
217
|
+
partition_cols=["reference_year"])
|
|
306
218
|
|
|
219
|
+
# For optimising `demand`, suggest partitioning on scenario and reference year
|
|
220
|
+
optimise_parquet.partition_traces_by_columns(input_directory="<path/to/store/demand>",
|
|
221
|
+
output_directory="<path/to/store/optimised_demand>",
|
|
222
|
+
partition_cols=["scenario", "reference_year"])
|
|
307
223
|
```
|
|
308
224
|
|
|
309
|
-
</details>
|
|
310
225
|
|
|
311
|
-
### Querying trace data for
|
|
226
|
+
### Querying trace data for sets of projects, zones or subregions
|
|
312
227
|
|
|
313
228
|
Often modelling or analysis will require a set of traces. For example, all the existing solar generators traces, all
|
|
314
229
|
the wind REZ traces, or all the subregion demand traces. To query a set of traces the names of generators, REZ IDs,
|
|
@@ -389,19 +304,16 @@ print(wind_generator_names)
|
|
|
389
304
|
# ['Bango 973 Wind Farm', 'Bango 999 Wind Farm', 'Boco Rock Wind Farm', 'Bodangora Wind Farm' . . .
|
|
390
305
|
|
|
391
306
|
|
|
392
|
-
#
|
|
393
|
-
|
|
394
|
-
solar_generator_traces = {}
|
|
307
|
+
# The project names can be used to retrieves a dataframe containing all project traces, which can be filtered by project name using the 'project' column"
|
|
395
308
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
directory=parsed_solar_data
|
|
309
|
+
solar_traces = get_data.get_project_single_reference_year(
|
|
310
|
+
start_year=2025,
|
|
311
|
+
end_year=2030,
|
|
312
|
+
reference_year=2011,
|
|
313
|
+
project=solar_generator_names,
|
|
314
|
+
directory="parsed_project_data"
|
|
403
315
|
)
|
|
404
|
-
|
|
316
|
+
|
|
405
317
|
```
|
|
406
318
|
|
|
407
319
|
</details>
|
|
@@ -448,35 +360,27 @@ onshore_rezs = build_limits[build_limits["Wind generation total limits (MW)_High
|
|
|
448
360
|
print(list(onshore_rezs['REZ ID']))
|
|
449
361
|
# ['Q1', 'Q2', 'Q3', 'Q4', 'Q5', 'Q6', . . .
|
|
450
362
|
|
|
451
|
-
# These sets of onshore and offshore REZ IDs
|
|
363
|
+
# These sets of onshore and offshore REZ IDs can the be used to retrieve a dataframes containing all relevant traces, which can be filtered by REZ name using the 'zone' column"
|
|
452
364
|
|
|
453
|
-
wind_offshore_rez_traces =
|
|
365
|
+
wind_offshore_rez_traces = get_data.get_zone_single_reference_year(
|
|
366
|
+
start_year=2025,
|
|
367
|
+
end_year=2026,
|
|
368
|
+
reference_year=2011,
|
|
369
|
+
zone=list(offshore_rezs['REZ ID']),
|
|
370
|
+
resource_type="WFL",
|
|
371
|
+
directory="parsed_zone_data"
|
|
372
|
+
)
|
|
454
373
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
)
|
|
464
|
-
wind_offshore_rez_traces[rez] = trace_for_rez
|
|
465
|
-
|
|
466
|
-
wind_onshore_rez_traces = {}
|
|
467
|
-
|
|
468
|
-
for rez in list(onshore_rezs['REZ ID']):
|
|
469
|
-
trace_for_rez = get_data.wind_area_single_reference_year(
|
|
470
|
-
start_year=2025,
|
|
471
|
-
end_year=2026,
|
|
472
|
-
reference_year=2011,
|
|
473
|
-
area=rez,
|
|
474
|
-
resource_quality='WH',
|
|
475
|
-
directory=parsed_wind_data
|
|
476
|
-
)
|
|
477
|
-
wind_onshore_rez_traces[rez] = trace_for_rez
|
|
478
|
-
```
|
|
374
|
+
wind_onshore_rez_traces = get_data.get_zone_single_reference_year(
|
|
375
|
+
start_year=2025,
|
|
376
|
+
end_year=2026,
|
|
377
|
+
reference_year=2011,
|
|
378
|
+
zone=list(onshore_rezs['REZ ID']),
|
|
379
|
+
resource_type="WH",
|
|
380
|
+
directory="parsed_zone_data"
|
|
381
|
+
)
|
|
479
382
|
|
|
383
|
+
```
|
|
480
384
|
</details>
|
|
481
385
|
|
|
482
386
|
|
|
@@ -513,20 +417,17 @@ onshore_solar_rezs = build_limits[build_limits["Solar PV plus Solar thermal Limi
|
|
|
513
417
|
print(list(onshore_solar_rezs['REZ ID']))
|
|
514
418
|
# ['Q1', 'Q2', 'Q3', 'Q4', 'Q5', 'Q6', . . .
|
|
515
419
|
|
|
516
|
-
#
|
|
420
|
+
# The set of REZ IDs can be used to retrieves a dataframe containing all REZ traces, which can be filtered by REZ name using the 'zone' column"
|
|
517
421
|
|
|
518
|
-
single_axis_tracking_traces =
|
|
422
|
+
single_axis_tracking_traces = get_data.get_zone_single_reference_year(
|
|
423
|
+
start_year=2025,
|
|
424
|
+
end_year=2026,
|
|
425
|
+
reference_year=2011,
|
|
426
|
+
zone=onshore_solar_rezs['REZ ID'],
|
|
427
|
+
resource_type="SAT",
|
|
428
|
+
directory="parsed_zone_data"
|
|
429
|
+
)
|
|
519
430
|
|
|
520
|
-
for rez in list(onshore_solar_rezs['REZ ID']):
|
|
521
|
-
trace_for_rez = get_data.solar_area_single_reference_year(
|
|
522
|
-
start_year=2025,
|
|
523
|
-
end_year=2026,
|
|
524
|
-
reference_year=2011,
|
|
525
|
-
area=rez,
|
|
526
|
-
technology='SAT',
|
|
527
|
-
directory=parsed_solar_data
|
|
528
|
-
)
|
|
529
|
-
single_axis_tracking_traces[rez] = trace_for_rez
|
|
530
431
|
```
|
|
531
432
|
|
|
532
433
|
</details>
|
|
@@ -561,27 +462,154 @@ subregions = list(set(rez_definitions["ISP Sub-region"]))
|
|
|
561
462
|
print(subregions)
|
|
562
463
|
# ['CSA', 'SESA', 'CQ', 'NQ', 'NNSW', 'CNSW', 'SNSW', 'SNW', 'TAS', 'VIC', 'SQ']
|
|
563
464
|
|
|
564
|
-
#
|
|
465
|
+
# "The list of subregion names retrieves a dataframe containing all subregion traces, which can be filtered or accessed by subregion name using the 'subregion' column"
|
|
565
466
|
|
|
566
|
-
|
|
467
|
+
demand_trace = get_demand_single_reference_year(
|
|
468
|
+
start_year=2025,
|
|
469
|
+
end_year=2026,
|
|
470
|
+
reference_year=2011,
|
|
471
|
+
scenario="Step Change",
|
|
472
|
+
subregion=subregions,
|
|
473
|
+
demand_type="OPSO_MODELLING",
|
|
474
|
+
poe="POE50",
|
|
475
|
+
directory="parsed_data/demand"
|
|
476
|
+
)
|
|
477
|
+
```
|
|
567
478
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
subregion=subregion,
|
|
574
|
-
demand_type='OPSO_MODELLING',
|
|
575
|
-
poe='POE50',
|
|
576
|
-
scenario='Step Change',
|
|
577
|
-
directory=parsed_demand_data
|
|
578
|
-
)
|
|
579
|
-
demand_traces[subregion] = trace
|
|
479
|
+
</details>
|
|
480
|
+
|
|
481
|
+
### Querying parsed trace data using alternative approach
|
|
482
|
+
|
|
483
|
+
Once trace data has been parsed it can also queried using legacy API functionality (based on around querying technologies, areas, rather for example).
|
|
580
484
|
|
|
485
|
+
<details>
|
|
486
|
+
<summary>Solar project traces from 2022 to 2024 (for a single reference year), and for 2022 and 2024 (multiple reference years)</summary>
|
|
487
|
+
<br>
|
|
488
|
+
|
|
489
|
+
```python
|
|
490
|
+
from isp_trace_parser import get_data
|
|
491
|
+
|
|
492
|
+
solar_project_trace_single_reference_year = get_data.solar_project_single_reference_year(
|
|
493
|
+
start_year=2022,
|
|
494
|
+
end_year=2024,
|
|
495
|
+
reference_year=2011,
|
|
496
|
+
project='Adelaide Desalination Plant Solar Farm',
|
|
497
|
+
directory='example_project_data/'
|
|
498
|
+
)
|
|
499
|
+
|
|
500
|
+
solar_project_trace_many_reference_years = get_data.solar_project_multiple_reference_years(
|
|
501
|
+
reference_years={2022: 2011, 2024: 2012},
|
|
502
|
+
project='Adelaide Desalination Plant Solar Farm',
|
|
503
|
+
directory='example_project_data/'
|
|
504
|
+
)
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
</details>
|
|
508
|
+
|
|
509
|
+
<details>
|
|
510
|
+
<summary>Solar area/REZ traces from 2022 to 2024 (for a single reference year), and for 2022 and 2024 (multiple reference years)</summary>
|
|
511
|
+
<br>
|
|
512
|
+
|
|
513
|
+
```python
|
|
514
|
+
from isp_trace_parser import get_data
|
|
515
|
+
solar_rez_trace_single_reference_years = get_data.solar_area_single_reference_year(
|
|
516
|
+
start_year=2022,
|
|
517
|
+
end_year=2024,
|
|
518
|
+
reference_year=2011,
|
|
519
|
+
area='Q1',
|
|
520
|
+
technology='SAT',
|
|
521
|
+
directory='example_rez_data/'
|
|
522
|
+
)
|
|
523
|
+
|
|
524
|
+
solar_rez_trace_many_reference_years = get_data.solar_area_multiple_reference_years(
|
|
525
|
+
reference_years={2022: 2011, 2024: 2012},
|
|
526
|
+
area='Q1',
|
|
527
|
+
technology='SAT',
|
|
528
|
+
directory='example_rez_data/'
|
|
529
|
+
)
|
|
581
530
|
```
|
|
582
531
|
|
|
583
532
|
</details>
|
|
584
533
|
|
|
534
|
+
<details>
|
|
535
|
+
<summary>Wind project traces from 2022 to 2024 (for a single reference year), and for 2022 and 2024 (multiple reference years)</summary>
|
|
536
|
+
<br>
|
|
537
|
+
|
|
538
|
+
```python
|
|
539
|
+
from isp_trace_parser import get_data
|
|
540
|
+
wind_project_trace_single_reference_years = get_data.wind_project_single_reference_year(
|
|
541
|
+
start_year=2022,
|
|
542
|
+
end_year=2024,
|
|
543
|
+
reference_year=2011,
|
|
544
|
+
project='Bango 973 Wind Farm',
|
|
545
|
+
directory='parsed_project_data/'
|
|
546
|
+
)
|
|
547
|
+
|
|
548
|
+
wind_project_trace_many_reference_years = get_data.wind_project_multiple_reference_years(
|
|
549
|
+
reference_years={2022: 2011, 2024: 2012},
|
|
550
|
+
project='Bango 973 Wind Farm',
|
|
551
|
+
directory='parsed_project_data/'
|
|
552
|
+
)
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
</details>
|
|
556
|
+
|
|
557
|
+
<details>
|
|
558
|
+
<summary>Wind area/REZ traces from 2022 to 2024 (for a single reference year), and for 2022 and 2024 (multiple reference years)</summary>
|
|
559
|
+
<br>
|
|
560
|
+
|
|
561
|
+
```python
|
|
562
|
+
from isp_trace_parser import get_data
|
|
563
|
+
wind_rez_trace_single_reference_years = get_data.wind_area_single_reference_year(
|
|
564
|
+
start_year=2022,
|
|
565
|
+
end_year=2024,
|
|
566
|
+
reference_year=2011,
|
|
567
|
+
area='Q1',
|
|
568
|
+
resource_quality='WH',
|
|
569
|
+
directory='parsed_rez_data/'
|
|
570
|
+
)
|
|
571
|
+
|
|
572
|
+
wind_rez_trace_many_reference_years = get_data.wind_area_multiple_reference_years(
|
|
573
|
+
reference_years={2022: 2011, 2024: 2012},
|
|
574
|
+
area='Q1',
|
|
575
|
+
resource_quality='WH',
|
|
576
|
+
directory='parsed_rez_data/'
|
|
577
|
+
)
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
</details>
|
|
581
|
+
|
|
582
|
+
<details>
|
|
583
|
+
<summary>OPSO_MODELLING POE10 traces from 2022 to 2024 (for a single reference year), and for 2024 (multiple reference years) from the "Green Energy Exports" scenario</summary>
|
|
584
|
+
<br>
|
|
585
|
+
|
|
586
|
+
```python
|
|
587
|
+
from isp_trace_parser import get_data
|
|
588
|
+
demand_subregion_trace_single_reference_years = get_data.demand_single_reference_year(
|
|
589
|
+
start_year=2024,
|
|
590
|
+
end_year=2024,
|
|
591
|
+
reference_year=2011,
|
|
592
|
+
subregion='CNSW',
|
|
593
|
+
scenario='Green Energy Exports',
|
|
594
|
+
poe='POE10',
|
|
595
|
+
demand_type='OPSO_MODELLING',
|
|
596
|
+
directory='parsed_demand_data/'
|
|
597
|
+
)
|
|
598
|
+
|
|
599
|
+
demand_subregion_trace_many_reference_years = get_data.demand_multiple_reference_years(
|
|
600
|
+
reference_years={2024: 2011},
|
|
601
|
+
subregion='CNSW',
|
|
602
|
+
scenario='Green Energy Exports',
|
|
603
|
+
poe='POE10',
|
|
604
|
+
demand_type='OPSO_MODELLING',
|
|
605
|
+
directory='parsed_demand_data/'
|
|
606
|
+
)
|
|
607
|
+
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
</details>
|
|
611
|
+
|
|
612
|
+
|
|
585
613
|
### Constructing a reference year mapping
|
|
586
614
|
|
|
587
615
|
A helper function is provided to allow you to construct reference year mappings for use with the `get_data` multiple reference year functions.
|
|
@@ -601,10 +629,10 @@ print(mapping)
|
|
|
601
629
|
# {2030: 2011, 2031: 2013, 2032: 2018, 2033: 2011, 2034: 2013, 2035: 2018}
|
|
602
630
|
```
|
|
603
631
|
|
|
604
|
-
###
|
|
632
|
+
### Polars DataFrame trace parsing
|
|
605
633
|
|
|
606
|
-
`isp-trace-parser` also exposes functionality for transforming input trace data (in a [`
|
|
607
|
-
`DataFrame`) in the AEMO format to a standard time series format (i.e. "
|
|
634
|
+
`isp-trace-parser` also exposes functionality for transforming input trace data (in a [`Polars`](https://pola.rs/)
|
|
635
|
+
`DataFrame`) in the AEMO format to a standard time series format (i.e. "datetime" and "value" columns). As shown
|
|
608
636
|
below, the data can be converted to polars from pandas before performing Dataframe trace parsing, and back to pandas
|
|
609
637
|
after the parsing is complete, the polars package provides [functionality for converting to and from `pandas`](https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.to_pandas.html).
|
|
610
638
|
|
|
@@ -628,7 +656,7 @@ aemo_format_data_as_polars = pl.from_pandas(aemo_format_data)
|
|
|
628
656
|
trace_parser_format_data = trace_formatter(aemo_format_data_as_polars)
|
|
629
657
|
|
|
630
658
|
print(trace_parser_format_data.to_pandas())
|
|
631
|
-
#
|
|
659
|
+
# datetime value
|
|
632
660
|
# 0 2024-06-01 00:30:00 11.2
|
|
633
661
|
# 1 2024-06-01 01:00:00 30.7
|
|
634
662
|
# 2 2024-06-02 00:00:00 17.1
|