isp-trace-parser 1.0.2__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.
Files changed (38) hide show
  1. {isp_trace_parser-1.0.2/src/isp_trace_parser.egg-info → isp_trace_parser-2.0.0}/PKG-INFO +284 -255
  2. isp_trace_parser-1.0.2/PKG-INFO → isp_trace_parser-2.0.0/README.md +278 -265
  3. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/pyproject.toml +6 -3
  4. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_name_mapping_configs/solar_project_mapping.yaml +1 -1
  5. isp_trace_parser-1.0.2/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 +3 -0
  6. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_name_mapping_configs/wind_project_mapping.yaml +1 -1
  7. isp_trace_parser-1.0.2/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 +2 -0
  8. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser/demand_traces.py +57 -47
  9. isp_trace_parser-2.0.0/src/isp_trace_parser/get_data.py +1362 -0
  10. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser/metadata_extractors.py +6 -5
  11. isp_trace_parser-2.0.0/src/isp_trace_parser/optimise_parquet.py +95 -0
  12. isp_trace_parser-2.0.0/src/isp_trace_parser/remote/__init__.py +5 -0
  13. isp_trace_parser-2.0.0/src/isp_trace_parser/remote/download.py +233 -0
  14. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser/solar_traces.py +66 -79
  15. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser/trace_formatter.py +10 -10
  16. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser/trace_restructure_helper_functions.py +18 -27
  17. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser/wind_traces.py +77 -91
  18. isp_trace_parser-1.0.2/README.md → isp_trace_parser-2.0.0/src/isp_trace_parser.egg-info/PKG-INFO +294 -252
  19. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser.egg-info/SOURCES.txt +9 -3
  20. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser.egg-info/requires.txt +2 -0
  21. isp_trace_parser-2.0.0/tests/test_download.py +140 -0
  22. isp_trace_parser-2.0.0/tests/test_get_data.py +425 -0
  23. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/tests/test_input_validation.py +15 -12
  24. isp_trace_parser-2.0.0/tests/test_optimise_parquet.py +37 -0
  25. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/tests/test_trace_file_meta_data_extraction.py +8 -6
  26. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/tests/test_trace_formatter.py +6 -6
  27. isp_trace_parser-2.0.0/tests/test_trace_parsers.py +78 -0
  28. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/tests/test_writing_save_names.py +21 -23
  29. isp_trace_parser-1.0.2/src/isp_trace_parser/get_data.py +0 -861
  30. isp_trace_parser-1.0.2/tests/test_directory_restructure.py +0 -131
  31. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/LICENSE +0 -0
  32. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/setup.cfg +0 -0
  33. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_name_mapping_configs/demand_scenario_mapping.yaml +0 -0
  34. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser/__init__.py +0 -0
  35. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser/construct_reference_year_mapping.py +0 -0
  36. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser/input_validation.py +0 -0
  37. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser.egg-info/dependency_links.txt +0 -0
  38. {isp_trace_parser-1.0.2 → isp_trace_parser-2.0.0}/src/isp_trace_parser.egg-info/top_level.txt +0 -0
@@ -1,8 +1,8 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: isp-trace-parser
3
- Version: 1.0.2
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>, prakaa <abiprakash007@gmail.com>, dylanjmcconnell <dylan.mcconnell@unsw.edu.au>
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,9 @@ 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
15
+ Dynamic: license-file
13
16
 
14
17
  # AEMO Integrated System Plan Trace Parser
15
18
 
@@ -25,7 +28,11 @@ Market Operator (AEMO) in their Integrated System Plan (ISP) modelling study.
25
28
  > [!IMPORTANT]
26
29
  > Currently, `isp-trace-parser` only supports trace data in the format of the 2024 ISP.
27
30
 
28
- ## Table of contents
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
29
36
 
30
37
  - [Install](#install)
31
38
  - [How the package works](#how-the-package-works)
@@ -33,8 +40,8 @@ Market Operator (AEMO) in their Integrated System Plan (ISP) modelling study.
33
40
  - [Key terminology](#key-terminology)
34
41
  - [Examples](#examples)
35
42
  - [Parsing trace data](#parsing-trace-data)
36
- - [Querying parsed trace data](#querying-parsed-trace-data)
37
- - [Querying trace data for a sets of generators, areas or subregions](#querying-trace-data-for-a-sets-of-generators-areas-or-subregions)
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)
38
45
  - [Constructing reference year mapping](#constructing-reference-year-mapping)
39
46
  - [Dataframe trace parsing](#dataframe-trace-parsing)
40
47
  - [Contributing](#contributing)
@@ -51,8 +58,8 @@ pip install isp-trace-parser
51
58
  1. Parse raw AEMO trace data using the functions `parse_wind_traces`, `parse_solar_traces`, and
52
59
  `parse_demand_traces`.
53
60
  - These functions reformat and restructure the data to a specified directory.
54
- - *Reformatting* puts the data in a standard time series format (i.e. with a `Datetime` column and `Values` column).
55
- - The data is *restructured* into half-yearly chunks in [Parquet](https://parquet.apache.org/) files, which significantly improves the speed at which data can be read from disk.
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.
56
63
  - To access the full documentation for these functions, you can run `help` in the Python console, e.g. `help(parse_wind_traces)`.
57
64
 
58
65
  2. Query the parsed data using the naming conventions for generators, renewable energy zones (REZs), and subregions established in the
@@ -61,26 +68,73 @@ pip install isp-trace-parser
61
68
  - To access the full documentation for these functions, you can run `help` in the Python console, e.g.
62
69
  `help(get_data.solar_project_trace_single_reference_year)`.
63
70
 
64
- ## Accessing raw trace data
71
+ ## Accessing trace data
65
72
 
73
+ ### Original trace data
66
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)
67
75
  and unzipped manually before the trace parser can be used.
68
76
 
69
- > [!Note]
70
- > However, it is likely future versions of the trace parser will automate this process by using a third party platform to host the trace data.
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
+ ```
71
118
 
72
119
  ## Key terminology
73
120
 
74
121
  ### Solar/wind
75
122
 
76
123
  - _**Project**_: Traces for a specific solar/wind project
77
- - _**Area**_: Traces for an area, e.g. a renewable energy zone
124
+ - _**Zone**_: Traces for a zone, e.g. a renewable energy zone
78
125
  - _**Reference year**_: A historical weather year that is used to produce the generation trace.
79
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)).
80
- - _**Technology**_ (solar): Fixed flat plate (FFP), single-axis tracking (SAT), concentrated solar thermal (CST).
81
- - _**Resource quality**_ (wind):
82
- - Onshore wind: Wind High (WH) and Wind Low (WL)
83
- - Offshore wind: Wind Offshore Fixed (WFX) and Wind Offshore Floating (WFL)
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)
84
138
 
85
139
  ### Demand
86
140
  - _**Reference year**_: A historical weather year that is used to produce the demand trace.
@@ -98,31 +152,10 @@ If AEMO trace data is downloaded onto a local machine, it can be reformatted usi
98
152
 
99
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).
100
154
 
101
- 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.
102
156
 
103
157
  ### Parsing all files in a directory
104
158
 
105
- ```python
106
- from isp_trace_parser import parse_solar_traces, parse_wind_traces, parse_demand_traces
107
-
108
- parse_solar_traces(
109
- input_directory='<path/to/aemo/solar/traces>',
110
- parsed_directory='<path/to/store/solar/output>',
111
- )
112
-
113
- parse_wind_traces(
114
- input_directory='<path/to/aemo/wind/traces>',
115
- parsed_directory='<path/to/store/wind/output>',
116
- )
117
-
118
- parse_demand_traces(
119
- input_directory='<path/to/aemo/demand/traces>',
120
- parsed_directory='<path/to/store/demand/output>',
121
- )
122
- ```
123
-
124
- ### Filtering which files get parsed
125
-
126
159
  ```python
127
160
  from isp_trace_parser import (
128
161
  parse_solar_traces,
@@ -135,179 +168,62 @@ from isp_trace_parser import (
135
168
 
136
169
  # Note: to not filter on a component of the metadata it can be excluded from the filter definition.
137
170
 
138
- solar_filters = SolarMetadataFilter(
139
- name=['N1'],
140
- file_type=['area'],
141
- technology=['SAT'],
142
- reference_year=[2011]
143
- )
144
-
171
+ filters = SolarMetadataFilter(file_type=["project"])
145
172
  parse_solar_traces(
146
173
  input_directory='<path/to/aemo/solar/traces>',
147
- parsed_directory='<path/to/store/solar/output>',
148
- filters=solar_filters
149
- )
150
-
151
- wind_filters = WindMetadataFilter(
152
- name=['N1'],
153
- file_type=['area'],
154
- resouce_quality=['WH'],
155
- reference_year=[2011]
174
+ parsed_directory='<path/to/store/project>',
175
+ filters = filters,
156
176
  )
157
177
 
178
+ filters = WindMetadataFilter(file_type=["project"])
158
179
  parse_wind_traces(
159
180
  input_directory='<path/to/aemo/wind/traces>',
160
- parsed_directory='<path/to/store/wind/output>',
161
- filters=wind_filters
162
- )
163
-
164
- demand_filters = DemandMetadataFilter(
165
- scenario=['Green Energy Exports'],
166
- subregion=['CNSW'],
167
- poe=['POE50'],
168
- demand_type=['OPSO_MODELLING'],
169
- reference_year=[2011]
170
- )
171
-
172
- parse_demand_traces(
173
- input_directory='<path/to/aemo/demand/traces>',
174
- parsed_directory='<path/to/store/demand/output>',
175
- filters=demand_filters
176
- )
177
- ```
178
-
179
- ### Querying parsed trace data
180
-
181
- Once trace data has been parsed it can be queried using the following API functionality.
182
-
183
- <details>
184
- <summary>Solar project traces from 2022 to 2024 (for a single reference year), and for 2022 and 2024 (multiple reference years)</summary>
185
- <br>
186
-
187
- ```python
188
- from isp_trace_parser import get_data
189
-
190
- solar_project_trace_single_reference_year = get_data.solar_project_single_reference_year(
191
- start_year=2022,
192
- end_year=2024,
193
- reference_year=2011,
194
- project='Adelaide Desalination Plant Solar Farm',
195
- directory='example_parsed_data/solar'
196
- )
197
-
198
- solar_project_trace_many_reference_years = get_data.solar_project_multiple_reference_years(
199
- reference_years={2022: 2011, 2024: 2012},
200
- project='Adelaide Desalination Plant Solar Farm',
201
- directory='example_parsed_data/solar'
181
+ parsed_directory='<path/to/store/project>',
182
+ filters = filters,
202
183
  )
203
- ```
204
184
 
205
- </details>
206
-
207
- <details>
208
- <summary>Solar area/REZ traces from 2022 to 2024 (for a single reference year), and for 2022 and 2024 (multiple reference years)</summary>
209
- <br>
210
-
211
- ```python
212
- from isp_trace_parser import get_data
213
- solar_rez_trace_single_reference_years = get_data.solar_area_single_reference_year(
214
- start_year=2022,
215
- end_year=2024,
216
- reference_year=2011,
217
- area='Q1',
218
- technology='SAT',
219
- directory='example_parsed_data/solar'
220
- )
221
-
222
- solar_rez_trace_many_reference_years = get_data.solar_area_multiple_reference_years(
223
- reference_years={2022: 2011, 2024: 2012},
224
- area='Q1',
225
- technology='SAT',
226
- directory='example_parsed_data/solar'
227
- )
228
- ```
229
-
230
- </details>
231
-
232
- <details>
233
- <summary>Wind project traces from 2022 to 2024 (for a single reference year), and for 2022 and 2024 (multiple reference years)</summary>
234
- <br>
235
-
236
- ```python
237
- from isp_trace_parser import get_data
238
- wind_project_trace_single_reference_years = get_data.wind_project_single_reference_year(
239
- start_year=2022,
240
- end_year=2024,
241
- reference_year=2011,
242
- project='Bango 973 Wind Farm',
243
- directory='example_parsed_data/wind'
244
- )
245
-
246
- wind_project_trace_many_reference_years = get_data.wind_project_multiple_reference_years(
247
- reference_years={2022: 2011, 2024: 2012},
248
- project='Bango 973 Wind Farm',
249
- 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,
250
190
  )
251
- ```
252
-
253
- </details>
254
-
255
- <details>
256
- <summary>Wind area/REZ traces from 2022 to 2024 (for a single reference year), and for 2022 and 2024 (multiple reference years)</summary>
257
- <br>
258
191
 
259
- ```python
260
- from isp_trace_parser import get_data
261
- wind_rez_trace_single_reference_years = get_data.wind_area_single_reference_year(
262
- start_year=2022,
263
- end_year=2024,
264
- reference_year=2011,
265
- area='Q1',
266
- resource_quality='WH',
267
- 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,
268
197
  )
269
198
 
270
- wind_rez_trace_many_reference_years = get_data.wind_area_multiple_reference_years(
271
- reference_years={2022: 2011, 2024: 2012},
272
- area='Q1',
273
- resource_quality='WH',
274
- directory='example_parsed_data/wind'
199
+ parse_demand_traces(
200
+ input_directory='<path/to/aemo/demand/traces>',
201
+ parsed_directory='<path/to/store/demand>',
275
202
  )
276
203
  ```
277
204
 
278
- </details>
205
+ ### Optimising stored data
206
+ The following code illustrates how the parsed parquet files can be consolidated and optimised with `optimise_parquet.py`
279
207
 
280
- <details>
281
- <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>
282
- <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).
283
210
 
284
211
  ```python
285
- from isp_trace_parser import get_data
286
- demand_subregion_trace_single_reference_years = get_data.demand_single_reference_year(
287
- start_year=2024,
288
- end_year=2024,
289
- reference_year=2011,
290
- subregion='CNSW',
291
- scenario='Green Energy Exports',
292
- poe='POE10',
293
- demand_type='OPSO_MODELLING',
294
- directory='example_parsed_data/demand'
295
- )
212
+ from isp_trace_parser import optimise_parquet
296
213
 
297
- demand_subregion_trace_many_reference_years = get_data.demand_multiple_reference_years(
298
- reference_years={2024: 2011},
299
- subregion='CNSW',
300
- scenario='Green Energy Exports',
301
- poe='POE10',
302
- demand_type='OPSO_MODELLING',
303
- directory='example_parsed_data/demand'
304
- )
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"])
305
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"])
306
223
  ```
307
224
 
308
- </details>
309
225
 
310
- ### Querying trace data for a sets of generators, areas or subregions
226
+ ### Querying trace data for sets of projects, zones or subregions
311
227
 
312
228
  Often modelling or analysis will require a set of traces. For example, all the existing solar generators traces, all
313
229
  the wind REZ traces, or all the subregion demand traces. To query a set of traces the names of generators, REZ IDs,
@@ -388,19 +304,16 @@ print(wind_generator_names)
388
304
  # ['Bango 973 Wind Farm', 'Bango 999 Wind Farm', 'Boco Rock Wind Farm', 'Bodangora Wind Farm' . . .
389
305
 
390
306
 
391
- # These names can be used to retrieve trace data
392
-
393
- 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"
394
308
 
395
- for generator_name in solar_generator_names:
396
- trace_for_generator = get_data.solar_project_single_reference_year(
397
- start_year=2025,
398
- end_year=2030,
399
- reference_year=2011,
400
- project=generator_name,
401
- 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"
402
315
  )
403
- solar_generator_traces[generator_name] = trace_for_generator
316
+
404
317
  ```
405
318
 
406
319
  </details>
@@ -447,35 +360,27 @@ onshore_rezs = build_limits[build_limits["Wind generation total limits (MW)_High
447
360
  print(list(onshore_rezs['REZ ID']))
448
361
  # ['Q1', 'Q2', 'Q3', 'Q4', 'Q5', 'Q6', . . .
449
362
 
450
- # These sets of onshore and offshore REZ IDs then can be used to retrieve trace data
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"
451
364
 
452
- 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
+ )
453
373
 
454
- for rez in list(offshore_rezs['REZ ID']):
455
- trace_for_rez = get_data.wind_area_single_reference_year(
456
- start_year=2025,
457
- end_year=2026,
458
- reference_year=2011,
459
- area=rez,
460
- resource_quality='WFL',
461
- directory=parsed_wind_data
462
- )
463
- wind_offshore_rez_traces[rez] = trace_for_rez
464
-
465
- wind_onshore_rez_traces = {}
466
-
467
- for rez in list(onshore_rezs['REZ ID']):
468
- trace_for_rez = get_data.wind_area_single_reference_year(
469
- start_year=2025,
470
- end_year=2026,
471
- reference_year=2011,
472
- area=rez,
473
- resource_quality='WH',
474
- directory=parsed_wind_data
475
- )
476
- wind_onshore_rez_traces[rez] = trace_for_rez
477
- ```
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
+ )
478
382
 
383
+ ```
479
384
  </details>
480
385
 
481
386
 
@@ -512,20 +417,17 @@ onshore_solar_rezs = build_limits[build_limits["Solar PV plus Solar thermal Limi
512
417
  print(list(onshore_solar_rezs['REZ ID']))
513
418
  # ['Q1', 'Q2', 'Q3', 'Q4', 'Q5', 'Q6', . . .
514
419
 
515
- # These sets of onshore and offshore REZ IDs then can be used to retrieve trace data
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"
516
421
 
517
- 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
+ )
518
430
 
519
- for rez in list(onshore_solar_rezs['REZ ID']):
520
- trace_for_rez = get_data.solar_area_single_reference_year(
521
- start_year=2025,
522
- end_year=2026,
523
- reference_year=2011,
524
- area=rez,
525
- technology='SAT',
526
- directory=parsed_solar_data
527
- )
528
- single_axis_tracking_traces[rez] = trace_for_rez
529
431
  ```
530
432
 
531
433
  </details>
@@ -560,27 +462,154 @@ subregions = list(set(rez_definitions["ISP Sub-region"]))
560
462
  print(subregions)
561
463
  # ['CSA', 'SESA', 'CQ', 'NQ', 'NNSW', 'CNSW', 'SNSW', 'SNW', 'TAS', 'VIC', 'SQ']
562
464
 
563
- # This set of subregions can then can be used to retrieve demand trace data
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"
564
466
 
565
- demand_traces = {}
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
+ ```
566
478
 
567
- for subregion in subregions:
568
- trace = get_data.demand_single_reference_year(
569
- start_year=2025,
570
- end_year=2026,
571
- reference_year=2011,
572
- subregion=subregion,
573
- demand_type='OPSO_MODELLING',
574
- poe='POE50',
575
- scenario='Step Change',
576
- directory=parsed_demand_data
577
- )
578
- 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).
579
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
+ )
580
530
  ```
581
531
 
582
532
  </details>
583
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
+
584
613
  ### Constructing a reference year mapping
585
614
 
586
615
  A helper function is provided to allow you to construct reference year mappings for use with the `get_data` multiple reference year functions.
@@ -600,10 +629,10 @@ print(mapping)
600
629
  # {2030: 2011, 2031: 2013, 2032: 2018, 2033: 2011, 2034: 2013, 2035: 2018}
601
630
  ```
602
631
 
603
- ### polars Dataframe trace parsing
632
+ ### Polars DataFrame trace parsing
604
633
 
605
- `isp-trace-parser` also exposes functionality for transforming input trace data (in a [`polars`](https://pola.rs/)
606
- `DataFrame`) in the AEMO format to a standard time series format (i.e. "Datetime" and "Values" columns). As shown
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
607
636
  below, the data can be converted to polars from pandas before performing Dataframe trace parsing, and back to pandas
608
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).
609
638
 
@@ -627,7 +656,7 @@ aemo_format_data_as_polars = pl.from_pandas(aemo_format_data)
627
656
  trace_parser_format_data = trace_formatter(aemo_format_data_as_polars)
628
657
 
629
658
  print(trace_parser_format_data.to_pandas())
630
- # Datetime Value
659
+ # datetime value
631
660
  # 0 2024-06-01 00:30:00 11.2
632
661
  # 1 2024-06-01 01:00:00 30.7
633
662
  # 2 2024-06-02 00:00:00 17.1