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