Skip to content

Commit 0a38fcc

Browse files
committed
Added forecast portion to FeederLoadAnalysisInput so examples can utilize it to pass through scenarios.
Signed-off-by: Jimmy Tung <jimmy.tung@zepben.com>
1 parent d5866d4 commit 0a38fcc

File tree

4 files changed

+97
-12
lines changed

4 files changed

+97
-12
lines changed

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
* `rating_threshold`
1414
* `simplify_plsi_threshold`
1515
* `emerg_amp_scaling`
16+
* Added `fla_forecast_config` to `FeederLoadAnalysisInput` which holds the config for forecast portion of feeder-load-analysis studies.
17+
* `scenario_id` : The id of forecast scenario
18+
* `year`: The year for forecast model
19+
* `pv_upgrade_threshold`: Watts threshold to indicate if a customer site will gain additional pv during scenario application (Default to 5000).
20+
* `bess_upgrade_threshold`: Watts threshold to indicate if a customer site will gain additional battery during scenario application (Default to 5000).
21+
* `seed`: Seed for scenario application (Default to 123).
1622

1723
### Enhancements
1824
* None.

src/zepben/eas/client/feeder_load_analysis_input.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,13 @@
1010
"FeederLoadAnalysisInput"
1111
]
1212

13+
from zepben.eas.client.fla_forecast_config import FlaForecastConfig
14+
1315

1416
@dataclass
1517
class FeederLoadAnalysisInput:
1618
""" A data class representing the configuration for a feeder load analysis study """
1719

18-
feeders: Optional[List[str]]
19-
"""The mRIDs of feeders to solve for feeder load analysis"""
20-
21-
substations: Optional[List[str]]
22-
"""The mRIDs of substations to solve for feeder load analysis"""
23-
24-
sub_geographical_regions: Optional[List[str]]
25-
"""The mRIDs of sub-Geographical Region to solve for feeder load analysis"""
26-
27-
geographical_regions: Optional[List[str]]
28-
"""The mRIDs of Geographical Region to solve for feeder load analysis"""
29-
3020
start_date: str
3121
"""Start date for this analysis"""
3222

@@ -47,3 +37,18 @@ class FeederLoadAnalysisInput:
4737

4838
output: str
4939
"""The file name of the resulting study"""
40+
41+
feeders: Optional[List[str]] = None
42+
"""The mRIDs of feeders to solve for feeder load analysis"""
43+
44+
substations: Optional[List[str]] = None
45+
"""The mRIDs of substations to solve for feeder load analysis"""
46+
47+
sub_geographical_regions: Optional[List[str]] = None
48+
"""The mRIDs of sub-Geographical Region to solve for feeder load analysis"""
49+
50+
geographical_regions: Optional[List[str]] = None
51+
"""The mRIDs of Geographical Region to solve for feeder load analysis"""
52+
53+
fla_forecast_config: Optional[FlaForecastConfig] = None
54+
"""The forecast configuration for this fla study"""
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2020 Zeppelin Bend Pty Ltd
2+
#
3+
# This Source Code Form is subject to the terms of the Mozilla Public
4+
# License, v. 2.0. If a copy of the MPL was not distributed with this
5+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
6+
from dataclasses import dataclass
7+
from typing import Optional
8+
9+
__all__ = [
10+
"FlaForecastConfig"
11+
]
12+
13+
14+
@dataclass
15+
class FlaForecastConfig:
16+
""" A data class representing the configuration for a forecast portion of a feeder load analysis study """
17+
18+
scenario_id: str
19+
"""The id of forecast scenario"""
20+
21+
year: int
22+
"""The year for forecast model"""
23+
24+
pv_upgrade_threshold: Optional[int] = 5000
25+
"""Watts threshold to indicate if a customer site will gain additional pv during scenario application (Default to 5000)."""
26+
27+
bess_upgrade_threshold: Optional[int] = 5000
28+
"""Watts threshold to indicate if a customer site will gain additional battery during scenario application (Default to 5000)."""
29+
30+
seed: Optional[int] = 123
31+
"""Seed for scenario application (Default to 123)."""
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
from zepben.eas.client.feeder_load_analysis_input import FeederLoadAnalysisInput
2+
from zepben.eas.client.fla_forecast_config import FlaForecastConfig
3+
4+
5+
def test_feeder_load_analysis_constructor():
6+
feeder_load_analysis_input = FeederLoadAnalysisInput(
7+
feeders=["feeder123"],
8+
substations=["sub1"],
9+
sub_geographical_regions=["sgr1"],
10+
geographical_regions=["gr1"],
11+
start_date="2022-04-01",
12+
end_date="2022-12-31",
13+
fetch_lv_network=True,
14+
process_feeder_loads=True,
15+
process_coincident_loads=True,
16+
aggregate_at_feeder_level=False,
17+
output="Test",
18+
fla_forecast_config=FlaForecastConfig(
19+
scenario_id="1",
20+
year=2030,
21+
pv_upgrade_threshold=8000,
22+
bess_upgrade_threshold=8000,
23+
seed=64513
24+
)
25+
)
26+
27+
assert feeder_load_analysis_input is not None
28+
assert feeder_load_analysis_input.feeders == ["feeder123"]
29+
assert feeder_load_analysis_input.substations == ["sub1"]
30+
assert feeder_load_analysis_input.sub_geographical_regions == ["sgr1"]
31+
assert feeder_load_analysis_input.geographical_regions == ["gr1"]
32+
assert feeder_load_analysis_input.start_date == "2022-04-01"
33+
assert feeder_load_analysis_input.end_date == "2022-12-31"
34+
assert feeder_load_analysis_input.fetch_lv_network == True
35+
assert feeder_load_analysis_input.process_feeder_loads == True
36+
assert feeder_load_analysis_input.process_coincident_loads == True
37+
assert feeder_load_analysis_input.aggregate_at_feeder_level == False
38+
assert feeder_load_analysis_input.output == "Test"
39+
assert feeder_load_analysis_input.fla_forecast_config.scenario_id == "1"
40+
assert feeder_load_analysis_input.fla_forecast_config.year == 2030
41+
assert feeder_load_analysis_input.fla_forecast_config.pv_upgrade_threshold == 8000
42+
assert feeder_load_analysis_input.fla_forecast_config.bess_upgrade_threshold == 8000
43+
assert feeder_load_analysis_input.fla_forecast_config.seed == 64513

0 commit comments

Comments
 (0)