gridappsd-python 2025.3.2a9__py3-none-any.whl → 2025.3.2a13__py3-none-any.whl
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.
- gridappsd/simulation.py +33 -35
- {gridappsd_python-2025.3.2a9.dist-info → gridappsd_python-2025.3.2a13.dist-info}/METADATA +1 -1
- {gridappsd_python-2025.3.2a9.dist-info → gridappsd_python-2025.3.2a13.dist-info}/RECORD +5 -5
- {gridappsd_python-2025.3.2a9.dist-info → gridappsd_python-2025.3.2a13.dist-info}/WHEEL +1 -1
- {gridappsd_python-2025.3.2a9.dist-info → gridappsd_python-2025.3.2a13.dist-info}/entry_points.txt +0 -0
gridappsd/simulation.py
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
from dataclasses import dataclass, field
|
|
2
|
-
|
|
3
|
-
import sys
|
|
1
|
+
from dataclasses import dataclass, field
|
|
2
|
+
|
|
4
3
|
import time
|
|
5
|
-
from copy import deepcopy
|
|
6
|
-
#import json
|
|
7
4
|
import logging
|
|
8
5
|
from typing import Dict, List, Union
|
|
9
6
|
|
|
10
7
|
import gridappsd.topics as t
|
|
8
|
+
from gridappsd import GridAPPSD
|
|
11
9
|
from . import json_extension as json
|
|
12
10
|
|
|
13
11
|
_log = logging.getLogger(__name__)
|
|
@@ -36,33 +34,33 @@ class ConfigBase:
|
|
|
36
34
|
|
|
37
35
|
@dataclass
|
|
38
36
|
class ModelCreationConfig(ConfigBase):
|
|
39
|
-
load_scaling_factor: str = "1"
|
|
40
|
-
schedule_name: str = "ieeezipload"
|
|
41
|
-
z_fraction: str = "0"
|
|
42
|
-
i_fraction: str = "1"
|
|
43
|
-
p_fraction: str = "0"
|
|
44
|
-
randomize_zipload_fractions: bool = False
|
|
45
|
-
use_houses: bool = False
|
|
37
|
+
load_scaling_factor: str = field(default = "1")
|
|
38
|
+
schedule_name: str = field(default = "ieeezipload")
|
|
39
|
+
z_fraction: str = field(default = "0")
|
|
40
|
+
i_fraction: str = field(default = "1")
|
|
41
|
+
p_fraction: str = field(default = "0")
|
|
42
|
+
randomize_zipload_fractions: bool = field(default = False)
|
|
43
|
+
use_houses: bool = field(default = False)
|
|
46
44
|
|
|
47
45
|
|
|
48
|
-
__default_model_creation_config__ = ModelCreationConfig()
|
|
46
|
+
# __default_model_creation_config__ = ModelCreationConfig()
|
|
49
47
|
|
|
50
48
|
|
|
51
49
|
@dataclass
|
|
52
50
|
class SimulationArgs(ConfigBase):
|
|
53
|
-
start_time: str = "1655321830"
|
|
54
|
-
duration: str = "300"
|
|
55
|
-
simulator: str = "GridLAB-D"
|
|
56
|
-
timestep_frequency: str = "1000"
|
|
57
|
-
timestep_increment: str = "1000"
|
|
58
|
-
run_realtime: bool = True
|
|
59
|
-
pause_after_measurements: bool = False
|
|
60
|
-
simulation_name: str = "ieee13nodeckt"
|
|
61
|
-
power_flow_solver_method: str = "NR"
|
|
62
|
-
model_creation_config: ModelCreationConfig =
|
|
51
|
+
start_time: str = field(default = "1655321830")
|
|
52
|
+
duration: str = field(default = "300")
|
|
53
|
+
simulator: str = field(default = "GridLAB-D")
|
|
54
|
+
timestep_frequency: str = field(default = "1000")
|
|
55
|
+
timestep_increment: str = field(default = "1000")
|
|
56
|
+
run_realtime: bool = field(default = True)
|
|
57
|
+
pause_after_measurements: bool = field(default = False)
|
|
58
|
+
simulation_name: str = field(default = "ieee13nodeckt")
|
|
59
|
+
power_flow_solver_method: str = field(default = "NR")
|
|
60
|
+
model_creation_config: ModelCreationConfig = field(default_factory = ModelCreationConfig)
|
|
63
61
|
|
|
64
62
|
|
|
65
|
-
__default_simulation_args__ = SimulationArgs()
|
|
63
|
+
# __default_simulation_args__ = SimulationArgs()
|
|
66
64
|
|
|
67
65
|
|
|
68
66
|
@dataclass
|
|
@@ -75,16 +73,16 @@ class ApplicationConfig(ConfigBase):
|
|
|
75
73
|
applications: List[Application] = field(default_factory=list)
|
|
76
74
|
|
|
77
75
|
|
|
78
|
-
__default_application_config__ = ApplicationConfig()
|
|
76
|
+
# __default_application_config__ = ApplicationConfig()
|
|
79
77
|
|
|
80
78
|
|
|
81
79
|
@dataclass
|
|
82
80
|
class TestConfig(ConfigBase):
|
|
83
81
|
events: List[Dict] = field(default_factory=list)
|
|
84
|
-
appId: str = ""
|
|
82
|
+
appId: str = field(default = "")
|
|
85
83
|
|
|
86
84
|
|
|
87
|
-
__default_test_config__ = TestConfig()
|
|
85
|
+
# __default_test_config__ = TestConfig()
|
|
88
86
|
|
|
89
87
|
|
|
90
88
|
@dataclass
|
|
@@ -95,18 +93,18 @@ class ServiceConfig(ConfigBase):
|
|
|
95
93
|
@dataclass
|
|
96
94
|
class PowerSystemConfig(ConfigBase):
|
|
97
95
|
Line_name: str
|
|
98
|
-
GeographicalRegion_name: str = None
|
|
99
|
-
SubGeographicalRegion_name: str = None
|
|
96
|
+
GeographicalRegion_name: str = field(default = None)
|
|
97
|
+
SubGeographicalRegion_name: str = field(default = None)
|
|
100
98
|
|
|
101
99
|
|
|
102
100
|
@dataclass
|
|
103
101
|
class SimulationConfig(ConfigBase):
|
|
104
102
|
power_system_config: PowerSystemConfig
|
|
105
|
-
|
|
106
|
-
simulation_config: SimulationArgs =
|
|
103
|
+
application_configs: List[ApplicationConfig] = field(default_factory=list)
|
|
104
|
+
simulation_config: SimulationArgs = field(default_factory=SimulationArgs)
|
|
107
105
|
service_configs: List[ServiceConfig] = field(default_factory=list)
|
|
108
|
-
application_config: ApplicationConfig =
|
|
109
|
-
test_config: TestConfig =
|
|
106
|
+
application_config: ApplicationConfig = field(default_factory=ApplicationConfig)
|
|
107
|
+
test_config: TestConfig = field(default_factory=TestConfig)
|
|
110
108
|
|
|
111
109
|
|
|
112
110
|
class Simulation:
|
|
@@ -121,8 +119,8 @@ class Simulation:
|
|
|
121
119
|
add_onmeasurement_callback, add_oncomplete_callback or add_onstart_callback method respectively.
|
|
122
120
|
"""
|
|
123
121
|
|
|
124
|
-
def __init__(self, gapps:
|
|
125
|
-
assert
|
|
122
|
+
def __init__(self, gapps: GridAPPSD, run_config: Union[Dict, SimulationConfig]):
|
|
123
|
+
assert isinstance(gapps, GridAPPSD), "Must be an instance of GridAPPSD"
|
|
126
124
|
if isinstance(run_config, SimulationConfig):
|
|
127
125
|
self._run_config = run_config.asdict()
|
|
128
126
|
elif isinstance(run_config, dict):
|
|
@@ -10,11 +10,11 @@ gridappsd/houses.py,sha256=Fdg8p-zFATcgJGP0VjaYIsjUSBnvTm2k2OGUgaq710Q,3275
|
|
|
10
10
|
gridappsd/json_extension.py,sha256=zV_ESqKwuY3eHtPzwjqbW18-FhCFWonGjXRi-ysa62w,3388
|
|
11
11
|
gridappsd/loghandler.py,sha256=G1-AXUa4HKapILG_3ynkRZIJ97YdncM9om--lI3PACA,2703
|
|
12
12
|
gridappsd/register_app.py,sha256=DnJHlxFIGsxupm_fiINvnf5lbrw-V9Ng9LOB0C70vKg,2570
|
|
13
|
-
gridappsd/simulation.py,sha256=
|
|
13
|
+
gridappsd/simulation.py,sha256=hpEoCd_mo7411LTymaN8MBNkAtfbQ9pOF4iZ02yeEoY,12548
|
|
14
14
|
gridappsd/timeseries.py,sha256=85DiltlBEen_TKvfEiFWvYiFemrpDvuu8z8LhboHcls,3201
|
|
15
15
|
gridappsd/topics.py,sha256=Wie5B-byF3sLqCzoCh1Z2vMjR4wjDgAoV_jXKky6128,12186
|
|
16
16
|
gridappsd/utils.py,sha256=HeiZEcFlnbbghbEn0febRn45umeoLq5U-gt-pOGd1VU,3167
|
|
17
|
-
gridappsd_python-2025.3.
|
|
18
|
-
gridappsd_python-2025.3.
|
|
19
|
-
gridappsd_python-2025.3.
|
|
20
|
-
gridappsd_python-2025.3.
|
|
17
|
+
gridappsd_python-2025.3.2a13.dist-info/METADATA,sha256=mGKHCJmYQYzhOpIhZHVYViTISQDmpibnYmGEqIwMTSM,11516
|
|
18
|
+
gridappsd_python-2025.3.2a13.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
19
|
+
gridappsd_python-2025.3.2a13.dist-info/entry_points.txt,sha256=wDoyDmqrxfE_jICSHyDxYbHagzUvt3Oex5_vKBLsiMo,94
|
|
20
|
+
gridappsd_python-2025.3.2a13.dist-info/RECORD,,
|
{gridappsd_python-2025.3.2a9.dist-info → gridappsd_python-2025.3.2a13.dist-info}/entry_points.txt
RENAMED
|
File without changes
|