isp-trace-parser 1.0.1__tar.gz → 1.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.
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/PKG-INFO +3 -3
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/README.md +1 -1
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/pyproject.toml +9 -4
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser/__init__.py +4 -5
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser/demand_traces.py +7 -7
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser/get_data.py +1 -2
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser/solar_traces.py +9 -9
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser/trace_formatter.py +1 -2
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser/trace_restructure_helper_functions.py +4 -3
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser/wind_traces.py +9 -9
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser.egg-info/PKG-INFO +3 -3
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/tests/test_directory_restructure.py +8 -22
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/tests/test_input_validation.py +6 -5
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/tests/test_trace_formatter.py +0 -1
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/LICENSE +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/setup.cfg +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_name_mapping_configs/demand_scenario_mapping.yaml +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_name_mapping_configs/solar_area_mapping.yaml +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_name_mapping_configs/solar_project_mapping.yaml +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_name_mapping_configs/wind_area_mapping.yaml +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_name_mapping_configs/wind_project_mapping.yaml +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser/construct_reference_year_mapping.py +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser/input_validation.py +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser/metadata_extractors.py +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser.egg-info/SOURCES.txt +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser.egg-info/dependency_links.txt +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser.egg-info/requires.txt +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser.egg-info/top_level.txt +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/tests/test_trace_file_meta_data_extraction.py +0 -0
- {isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/tests/test_writing_save_names.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: isp-trace-parser
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: A Python package for reformatting and accessing demand, solar, and wind time series data used by the
|
|
5
5
|
Author-email: nick-gorman <n.gorman305@gmail.com>, prakaa <abiprakash007@gmail.com>, dylanjmcconnell <dylan.mcconnell@unsw.edu.au>
|
|
6
6
|
Requires-Python: >=3.9
|
|
@@ -17,7 +17,7 @@ Requires-Dist: joblib>=1.4.2
|
|
|
17
17
|
[](https://github.com/Open-ISP/isp-trace-parser/actions/workflows/cicd.yml)
|
|
18
18
|
[](https://codecov.io/gh/Open-ISP/isp-trace-parser)
|
|
19
19
|
[](https://results.pre-commit.ci/latest/github/Open-ISP/isp-trace-parser/main)
|
|
20
|
-
[](https://github.com/astral-sh/uv)
|
|
21
21
|
|
|
22
22
|
A Python package for reformatting and accessing demand, solar generation and wind generation time series data used by the Australian Energy
|
|
23
23
|
Market Operator (AEMO) in their Integrated System Plan (ISP) modelling study.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://github.com/Open-ISP/isp-trace-parser/actions/workflows/cicd.yml)
|
|
5
5
|
[](https://codecov.io/gh/Open-ISP/isp-trace-parser)
|
|
6
6
|
[](https://results.pre-commit.ci/latest/github/Open-ISP/isp-trace-parser/main)
|
|
7
|
-
[](https://github.com/astral-sh/uv)
|
|
8
8
|
|
|
9
9
|
A Python package for reformatting and accessing demand, solar generation and wind generation time series data used by the Australian Energy
|
|
10
10
|
Market Operator (AEMO) in their Integrated System Plan (ISP) modelling study.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "isp-trace-parser"
|
|
3
|
-
version = "1.0.
|
|
3
|
+
version = "1.0.2"
|
|
4
4
|
description = """A Python package for reformatting and accessing demand, solar, and wind time series data used by the
|
|
5
5
|
Australian Energy Market Operator in their Integrated System Plan modelling study."""
|
|
6
6
|
authors = [
|
|
@@ -21,10 +21,10 @@ requires-python = ">= 3.9"
|
|
|
21
21
|
requires = ["setuptools>=61.0", "wheel"]
|
|
22
22
|
build-backend = "setuptools.build_meta"
|
|
23
23
|
|
|
24
|
-
[tool.
|
|
24
|
+
[tool.uv]
|
|
25
25
|
managed = true
|
|
26
26
|
dev-dependencies = [
|
|
27
|
-
"ipython>=8.
|
|
27
|
+
"ipython>=8.0",
|
|
28
28
|
"ipdb>=0.13.13",
|
|
29
29
|
"pytest>=8.3.2",
|
|
30
30
|
"pytest-cov>=5.0.0",
|
|
@@ -41,8 +41,13 @@ testpaths = ["src", "tests"]
|
|
|
41
41
|
# addopts = add options
|
|
42
42
|
# --cov points pytest-cov to the src/ dir
|
|
43
43
|
# --cov-branch runs branch coverage
|
|
44
|
-
addopts = "-ra --doctest-modules --cov=src/ --cov-branch --cov-report xml:tests/coverage.xml --cov-report html:tests/htmlcov"
|
|
44
|
+
#addopts = "-ra --doctest-modules --cov=src/ --cov-branch --cov-report xml:tests/coverage.xml --cov-report html:tests/htmlcov"
|
|
45
45
|
|
|
46
|
+
[tool.ruff.lint]
|
|
47
|
+
select = [
|
|
48
|
+
# isort
|
|
49
|
+
"I",
|
|
50
|
+
]
|
|
46
51
|
|
|
47
52
|
[tool.setuptools.packages.find]
|
|
48
53
|
where = ["src"]
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
from isp_trace_parser.trace_formatter import trace_formatter
|
|
2
|
-
from isp_trace_parser.wind_traces import parse_wind_traces, WindMetadataFilter
|
|
3
|
-
from isp_trace_parser.solar_traces import parse_solar_traces, SolarMetadataFilter
|
|
4
|
-
from isp_trace_parser.demand_traces import parse_demand_traces, DemandMetadataFilter
|
|
5
1
|
from isp_trace_parser import get_data
|
|
6
2
|
from isp_trace_parser.construct_reference_year_mapping import (
|
|
7
3
|
construct_reference_year_mapping,
|
|
8
4
|
)
|
|
9
|
-
|
|
5
|
+
from isp_trace_parser.demand_traces import DemandMetadataFilter, parse_demand_traces
|
|
6
|
+
from isp_trace_parser.solar_traces import SolarMetadataFilter, parse_solar_traces
|
|
7
|
+
from isp_trace_parser.trace_formatter import trace_formatter
|
|
8
|
+
from isp_trace_parser.wind_traces import WindMetadataFilter, parse_wind_traces
|
|
10
9
|
|
|
11
10
|
__all__ = [
|
|
12
11
|
"trace_formatter",
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import functools
|
|
2
2
|
import os
|
|
3
|
-
from joblib import Parallel, delayed
|
|
4
3
|
from pathlib import Path
|
|
5
|
-
from typing import
|
|
6
|
-
import yaml
|
|
4
|
+
from typing import Literal, Optional
|
|
7
5
|
|
|
6
|
+
import yaml
|
|
7
|
+
from joblib import Parallel, delayed
|
|
8
8
|
from pydantic import BaseModel, validate_call
|
|
9
9
|
|
|
10
|
+
from isp_trace_parser import input_validation
|
|
10
11
|
from isp_trace_parser.metadata_extractors import extract_demand_trace_metadata
|
|
11
12
|
from isp_trace_parser.trace_restructure_helper_functions import (
|
|
12
|
-
|
|
13
|
+
add_half_year_as_column,
|
|
13
14
|
check_filter_by_metadata,
|
|
15
|
+
get_all_filepaths,
|
|
14
16
|
read_trace_csv,
|
|
15
|
-
trace_formatter,
|
|
16
|
-
add_half_year_as_column,
|
|
17
17
|
save_half_year_chunk_of_trace,
|
|
18
|
+
trace_formatter,
|
|
18
19
|
)
|
|
19
|
-
from isp_trace_parser import input_validation
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class DemandMetadataFilter(BaseModel):
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import functools
|
|
2
2
|
import os
|
|
3
|
-
from joblib import Parallel, delayed
|
|
4
3
|
from pathlib import Path
|
|
5
|
-
from typing import
|
|
6
|
-
import yaml
|
|
4
|
+
from typing import Literal, Optional
|
|
7
5
|
|
|
6
|
+
import yaml
|
|
7
|
+
from joblib import Parallel, delayed
|
|
8
8
|
from pydantic import BaseModel, validate_call
|
|
9
9
|
|
|
10
|
+
from isp_trace_parser import input_validation
|
|
10
11
|
from isp_trace_parser.metadata_extractors import extract_solar_trace_metadata
|
|
11
12
|
from isp_trace_parser.trace_restructure_helper_functions import (
|
|
13
|
+
check_filter_by_metadata,
|
|
12
14
|
get_all_filepaths,
|
|
15
|
+
get_just_filepaths,
|
|
16
|
+
get_metadata_for_writing_save_name,
|
|
17
|
+
get_metadata_that_matches_reference_year,
|
|
13
18
|
get_metadata_that_matches_trace_names,
|
|
19
|
+
get_unique_project_and_area_names_in_input_files,
|
|
14
20
|
get_unique_reference_years_in_metadata,
|
|
15
|
-
get_metadata_that_matches_reference_year,
|
|
16
|
-
get_metadata_for_writing_save_name,
|
|
17
21
|
overwrite_metadata_trace_name_with_output_name,
|
|
18
|
-
check_filter_by_metadata,
|
|
19
22
|
process_and_save_files,
|
|
20
|
-
get_unique_project_and_area_names_in_input_files,
|
|
21
|
-
get_just_filepaths,
|
|
22
23
|
)
|
|
23
|
-
from isp_trace_parser import input_validation
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class SolarMetadataFilter(BaseModel):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
1
|
from datetime import timedelta
|
|
2
|
+
from pathlib import Path
|
|
3
3
|
|
|
4
4
|
import polars as pl
|
|
5
5
|
from pydantic import BaseModel
|
|
@@ -96,11 +96,12 @@ def get_metadata_that_matches_trace_names(
|
|
|
96
96
|
) -> dict[Path, dict[str, str]]:
|
|
97
97
|
if isinstance(trace_names, str):
|
|
98
98
|
trace_names = [trace_names]
|
|
99
|
-
|
|
100
|
-
f: metadata
|
|
99
|
+
matching_meta_data = {
|
|
100
|
+
f: metadata.copy()
|
|
101
101
|
for f, metadata in all_input_file_metadata.items()
|
|
102
102
|
if metadata["name"] in trace_names
|
|
103
103
|
}
|
|
104
|
+
return matching_meta_data
|
|
104
105
|
|
|
105
106
|
|
|
106
107
|
def get_unique_reference_years_in_metadata(
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import functools
|
|
2
2
|
import os
|
|
3
|
-
from joblib import Parallel, delayed
|
|
4
3
|
from pathlib import Path
|
|
5
|
-
from typing import
|
|
6
|
-
import yaml
|
|
4
|
+
from typing import Literal, Optional
|
|
7
5
|
|
|
6
|
+
import yaml
|
|
7
|
+
from joblib import Parallel, delayed
|
|
8
8
|
from pydantic import BaseModel, validate_call
|
|
9
9
|
|
|
10
|
+
from isp_trace_parser import input_validation
|
|
10
11
|
from isp_trace_parser.metadata_extractors import extract_wind_trace_metadata
|
|
11
12
|
from isp_trace_parser.trace_restructure_helper_functions import (
|
|
13
|
+
check_filter_by_metadata,
|
|
14
|
+
filter_mapping_by_names_in_input_files,
|
|
12
15
|
get_all_filepaths,
|
|
16
|
+
get_metadata_for_writing_save_name,
|
|
17
|
+
get_metadata_that_matches_reference_year,
|
|
13
18
|
get_metadata_that_matches_trace_names,
|
|
19
|
+
get_unique_project_and_area_names_in_input_files,
|
|
14
20
|
get_unique_reference_years_in_metadata,
|
|
15
|
-
get_metadata_that_matches_reference_year,
|
|
16
|
-
get_metadata_for_writing_save_name,
|
|
17
21
|
overwrite_metadata_trace_name_with_output_name,
|
|
18
|
-
check_filter_by_metadata,
|
|
19
22
|
process_and_save_files,
|
|
20
|
-
get_unique_project_and_area_names_in_input_files,
|
|
21
|
-
filter_mapping_by_names_in_input_files,
|
|
22
23
|
)
|
|
23
|
-
from isp_trace_parser import input_validation
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class WindMetadataFilter(BaseModel):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: isp-trace-parser
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.2
|
|
4
4
|
Summary: A Python package for reformatting and accessing demand, solar, and wind time series data used by the
|
|
5
5
|
Author-email: nick-gorman <n.gorman305@gmail.com>, prakaa <abiprakash007@gmail.com>, dylanjmcconnell <dylan.mcconnell@unsw.edu.au>
|
|
6
6
|
Requires-Python: >=3.9
|
|
@@ -17,7 +17,7 @@ Requires-Dist: joblib>=1.4.2
|
|
|
17
17
|
[](https://github.com/Open-ISP/isp-trace-parser/actions/workflows/cicd.yml)
|
|
18
18
|
[](https://codecov.io/gh/Open-ISP/isp-trace-parser)
|
|
19
19
|
[](https://results.pre-commit.ci/latest/github/Open-ISP/isp-trace-parser/main)
|
|
20
|
-
[](https://github.com/astral-sh/uv)
|
|
21
21
|
|
|
22
22
|
A Python package for reformatting and accessing demand, solar generation and wind generation time series data used by the Australian Energy
|
|
23
23
|
Market Operator (AEMO) in their Integrated System Plan (ISP) modelling study.
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
import yaml
|
|
3
1
|
import itertools
|
|
4
2
|
import multiprocessing as mp
|
|
5
|
-
|
|
6
|
-
import pytest
|
|
7
|
-
|
|
8
|
-
from isp_trace_parser import parse_solar_traces, parse_demand_traces, parse_wind_traces
|
|
3
|
+
from pathlib import Path
|
|
9
4
|
|
|
10
5
|
import end_to_end_test_data_config as config
|
|
6
|
+
import pytest
|
|
7
|
+
import yaml
|
|
11
8
|
from create_end_to_end_test_data import (
|
|
12
|
-
create_solar_csvs,
|
|
13
9
|
create_demand_csvs,
|
|
10
|
+
create_solar_csvs,
|
|
14
11
|
create_wind_csvs,
|
|
15
12
|
)
|
|
16
13
|
|
|
14
|
+
from isp_trace_parser import parse_demand_traces, parse_solar_traces, parse_wind_traces
|
|
15
|
+
|
|
17
16
|
mp.set_start_method("spawn", force=True)
|
|
18
17
|
|
|
19
18
|
|
|
@@ -70,28 +69,15 @@ def test_wind_directory_restructure(tmp_path, use_concurrency):
|
|
|
70
69
|
new_dir.mkdir()
|
|
71
70
|
create_wind_csvs(old_dir)
|
|
72
71
|
parse_wind_traces(old_dir, new_dir, use_concurrency=use_concurrency)
|
|
73
|
-
project_mapping_yaml = Path(__file__).parent.parent / Path(
|
|
74
|
-
"src/isp_trace_name_mapping_configs/wind_project_mapping.yaml"
|
|
75
|
-
)
|
|
76
|
-
with open(project_mapping_yaml) as f:
|
|
77
|
-
project_name_mapping = yaml.safe_load(f)
|
|
78
|
-
|
|
79
|
-
reverse_project_name_mapping = {}
|
|
80
|
-
for name, mapping_data in project_name_mapping.items():
|
|
81
|
-
if isinstance(mapping_data["CSVFile"], list):
|
|
82
|
-
for csv_file in mapping_data["CSVFile"]:
|
|
83
|
-
reverse_project_name_mapping[csv_file] = name
|
|
84
|
-
else:
|
|
85
|
-
reverse_project_name_mapping[mapping_data["CSVFile"]] = name
|
|
86
72
|
|
|
87
73
|
combos = itertools.product(
|
|
88
74
|
config.reference_years,
|
|
89
75
|
range(config.start, config.end),
|
|
90
76
|
config.half_years,
|
|
91
|
-
config.wind_projects,
|
|
77
|
+
config.wind_projects.keys(),
|
|
92
78
|
)
|
|
93
79
|
for ry, y, half_year, project in combos:
|
|
94
|
-
project =
|
|
80
|
+
project = project.replace(" ", "_")
|
|
95
81
|
parquet_file = Path(
|
|
96
82
|
f"RefYear{ry}/Project/{project}/RefYear{ry}_{project}_HalfYear{y}-"
|
|
97
83
|
f"{half_year}.parquet"
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import pytest
|
|
2
1
|
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
3
4
|
from pydantic import ValidationError
|
|
4
5
|
|
|
5
6
|
from isp_trace_parser import (
|
|
7
|
+
DemandMetadataFilter,
|
|
6
8
|
SolarMetadataFilter,
|
|
7
9
|
WindMetadataFilter,
|
|
8
|
-
|
|
10
|
+
construct_reference_year_mapping,
|
|
11
|
+
input_validation,
|
|
12
|
+
parse_demand_traces,
|
|
9
13
|
parse_solar_traces,
|
|
10
14
|
parse_wind_traces,
|
|
11
|
-
parse_demand_traces,
|
|
12
|
-
construct_reference_year_mapping,
|
|
13
15
|
)
|
|
14
|
-
from isp_trace_parser import input_validation
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
# Tests for Pydantic classes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser/metadata_extractors.py
RENAMED
|
File without changes
|
|
File without changes
|
{isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser.egg-info/requires.txt
RENAMED
|
File without changes
|
{isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/src/isp_trace_parser.egg-info/top_level.txt
RENAMED
|
File without changes
|
{isp_trace_parser-1.0.1 → isp_trace_parser-1.0.2}/tests/test_trace_file_meta_data_extraction.py
RENAMED
|
File without changes
|
|
File without changes
|