gridappsd-python 2026.2.1__tar.gz → 2026.2.1a1__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 (44) hide show
  1. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/PKG-INFO +1 -1
  2. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/simulation.py +22 -8
  3. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/pyproject.toml +1 -1
  4. gridappsd_python-2026.2.1a1/tests/test_simulation.py +76 -0
  5. gridappsd_python-2026.2.1/tests/test_simulation.py +0 -65
  6. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/.gitignore +0 -0
  7. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/CHANGELOG.md +0 -0
  8. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/README.md +0 -0
  9. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/conf/entrypoint.sh +0 -0
  10. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/conf/run-gridappsd.sh +0 -0
  11. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/example.env +0 -0
  12. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/__init__.py +0 -0
  13. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/__main__.py +0 -0
  14. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/app_registration.py +0 -0
  15. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/difference_builder.py +0 -0
  16. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/docker_handler.py +0 -0
  17. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/field_interface/__init__.py +0 -0
  18. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/goss.py +0 -0
  19. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/gridappsd.py +0 -0
  20. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/houses.py +0 -0
  21. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/json_extension.py +0 -0
  22. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/loghandler.py +0 -0
  23. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/register_app.py +0 -0
  24. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/timeseries.py +0 -0
  25. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/topics.py +0 -0
  26. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd/utils.py +0 -0
  27. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/gridappsd_python_testing.ipynb +0 -0
  28. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/info/CHANGELOG.md +0 -0
  29. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/info/VERSION +0 -0
  30. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/poetry.toml +0 -0
  31. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/conftest.py +0 -0
  32. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/run_gridappsd.py +0 -0
  33. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/simulation_fixtures/13_node_2_min_base.json +0 -0
  34. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/test_containers.py +0 -0
  35. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/test_difference_builder.py +0 -0
  36. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/test_docker_handler.py +0 -0
  37. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/test_goss.py +0 -0
  38. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/test_gridappsd.py +0 -0
  39. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/test_houses.py +0 -0
  40. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/test_json.py +0 -0
  41. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/test_logging.py +0 -0
  42. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/test_logging_integration.py +0 -0
  43. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/test_topics.py +0 -0
  44. {gridappsd_python-2026.2.1 → gridappsd_python-2026.2.1a1}/tests/unittest_test_template.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gridappsd-python
3
- Version: 2026.2.1
3
+ Version: 2026.2.1a1
4
4
  Summary: A GridAPPS-D Python Adapter
5
5
  Project-URL: Repository, https://github.com/GRIDAPPSD/gridappsd-python
6
6
  Project-URL: Homepage, https://gridappsd.readthedocs.io
@@ -42,11 +42,11 @@ class ConfigBase:
42
42
 
43
43
  @dataclass
44
44
  class ModelCreationConfig(ConfigBase):
45
- load_scaling_factor: str = field(default="1")
45
+ load_scaling_factor: float = field(default=1)
46
46
  schedule_name: str = field(default="ieeezipload")
47
- z_fraction: str = field(default="0")
48
- i_fraction: str = field(default="1")
49
- p_fraction: str = field(default="0")
47
+ z_fraction: float = field(default=0)
48
+ i_fraction: float = field(default=1)
49
+ p_fraction: float = field(default=0)
50
50
  randomize_zipload_fractions: bool = field(default=False)
51
51
  use_houses: bool = field(default=False)
52
52
 
@@ -56,14 +56,28 @@ class ModelCreationConfig(ConfigBase):
56
56
 
57
57
  @dataclass
58
58
  class SimulationArgs(ConfigBase):
59
- start_time: str = field(default="1655321830")
60
- duration: str = field(default="300")
61
- timestep_frequency: str = field(default="1000")
62
- timestep_increment: str = field(default="1000")
59
+ start_time: int = field(default=1655321830)
60
+ duration: int = field(default=300)
61
+ publish_period: int = field(default=None)
62
+ interval: int = field(default=None)
63
63
  run_realtime: bool = field(default=True)
64
64
  pause_after_measurements: bool = field(default=False)
65
65
  simulation_name: str = field(default="ieee13nodeckt")
66
66
 
67
+ def __post_init_(self):
68
+ if self.run_realtime:
69
+ self.interval = 1
70
+ if not self.publish_period:
71
+ self.publish_period = 3
72
+ else:
73
+ if not self.interval:
74
+ self.interval = 60
75
+ if not self.publish_period:
76
+ self.publish_period = 60
77
+ if self.publish_period < self.interval:
78
+ raise RuntimeError("A simulation's publishing_period cannot be less than the simulation's timestep "
79
+ "interval. please make the publishing_period >= interval!")
80
+
67
81
 
68
82
  @dataclass
69
83
  class SimulatorArgs(ConfigBase):
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "gridappsd-python"
7
- version = "2026.02.1"
7
+ version = "2026.02.1a1"
8
8
  description = "A GridAPPS-D Python Adapter"
9
9
  readme = "README.md"
10
10
  license = "BSD-3-Clause"
@@ -0,0 +1,76 @@
1
+ import json
2
+ import logging
3
+ import os
4
+ import sys
5
+ import time
6
+ import pytest
7
+ from datetime import datetime, timezone
8
+
9
+ logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
10
+
11
+ from gridappsd import GridAPPSD, topics as t
12
+ from gridappsd.simulation import Simulation, PowerSystemConfig, SimulationArgs, SimulationConfig
13
+
14
+ simulation_is_complete = False
15
+ measurements_received = 0
16
+
17
+ @pytest.fixture
18
+ def createGadObject():
19
+ gad_user = os.environ.get('GRIDAPPSD_USER')
20
+ if gad_user is None:
21
+ os.environ['GRIDAPPSD_USER'] = 'system'
22
+ gad_password = os.environ.get('GRIDAPPSD_PASSWORD')
23
+ if gad_password is None:
24
+ os.environ['GRIDAPPSD_PASSWORD'] = 'manager'
25
+ return GridAPPSD()
26
+
27
+ @pytest.mark.integration
28
+ def test_createSimulations(createGadObject):
29
+ gadObj = createGadObject
30
+ response = gadObj.query_model_info()
31
+ models = response.get("data", {}).get("models", {})
32
+ start_time = int(datetime(year=2025,
33
+ month=1,
34
+ day=1,
35
+ hour=0,
36
+ minute=0,
37
+ second=0,
38
+ microsecond=0,
39
+ tzinfo=timezone.utc).timestamp())
40
+ simulationArgs = SimulationArgs(start_time=start_time,
41
+ duration=300,
42
+ run_realtime=False,
43
+ interval=60,
44
+ publish_period=120,
45
+ pause_after_measurements=False)
46
+ sim_config = SimulationConfig(simulation_config=simulationArgs)
47
+ modelsToRun = [
48
+ "49AD8E07-3BF9-A4E2-CB8F-C3722F837B62", # IEEE 13 Node Test Feeder contains 175 measurements
49
+ "C1C3E687-6FFD-C753-582B-632A27E28507", # IEEE 123 Node Test Feeder contains 782 measurements
50
+ "5B816B93-7A5F-B64C-8460-47C17D6E4B0F" # IEEE 13 Node Assets Test Feeder contains 127 measurements
51
+ ]
52
+ for m in models:
53
+ if m.get("modelId") not in modelsToRun:
54
+ continue
55
+ line_name = m.get("modelId")
56
+ subregion_name = m.get("subRegionId")
57
+ region_name = m.get("regionId")
58
+ psc = PowerSystemConfig(Line_name=line_name,
59
+ SubGeographicalRegion_name=subregion_name,
60
+ GeographicalRegion_name=region_name)
61
+ sim_config.power_system_configs.append(psc)
62
+ sim_obj = Simulation(gapps=gadObj, run_config=sim_config)
63
+ def on_measurement(sim, ts, m):
64
+ global measurements_received
65
+ assert len(m) == 1084
66
+ measurements_received += 1
67
+ def on_simulation_complete(sim):
68
+ global simulation_is_complete
69
+ simulation_is_complete = True
70
+ sim_obj.add_onmeasurement_callback(on_measurement)
71
+ sim_obj.add_oncomplete_callback(on_simulation_complete)
72
+ sim_obj.start_simulation()
73
+ while not simulation_is_complete:
74
+ time.sleep(1)
75
+ assert measurements_received == 2
76
+ gadObj.disconnect()
@@ -1,65 +0,0 @@
1
- import json
2
- import logging
3
- import os
4
- import sys
5
- import time
6
- import pytest
7
- from datetime import datetime, timezone
8
-
9
- logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
10
-
11
- from gridappsd import GridAPPSD, topics as t
12
- from gridappsd.simulation import Simulation, PowerSystemConfig, SimulationArgs, SimulationConfig
13
-
14
- simulation_is_complete = False
15
- measurements_received = 0
16
-
17
- @pytest.fixture
18
- def createGadObject():
19
- gad_user = os.environ.get('GRIDAPPSD_USER')
20
- if gad_user is None:
21
- os.environ['GRIDAPPSD_USER'] = 'system'
22
- gad_password = os.environ.get('GRIDAPPSD_PASSWORD')
23
- if gad_password is None:
24
- os.environ['GRIDAPPSD_PASSWORD'] = 'manager'
25
- return GridAPPSD()
26
-
27
- @pytest.mark.integration
28
- def test_createSimulations(createGadObject):
29
- gadObj = createGadObject
30
- response = gadObj.query_model_info()
31
- models = response.get("data", {}).get("models", {})
32
- start_time = int(datetime(year=2025, month=1, day=1, hour=0, minute=0, second=0, microsecond=0, tzinfo=timezone.utc).timestamp())
33
- simulationArgs = SimulationArgs(start_time=f"{start_time}",
34
- duration="120",
35
- run_realtime=False,
36
- pause_after_measurements=False)
37
- sim_config = SimulationConfig(simulation_config=simulationArgs)
38
- modelsToRun = [
39
- "49AD8E07-3BF9-A4E2-CB8F-C3722F837B62", # IEEE 13 Node Test Feeder
40
- "C1C3E687-6FFD-C753-582B-632A27E28507" # IEEE 123 Node Test Feeder
41
- ]
42
- for m in models:
43
- if m.get("modelId") not in modelsToRun:
44
- continue
45
- line_name = m.get("modelId")
46
- subregion_name = m.get("subRegionId")
47
- region_name = m.get("regionId")
48
- psc = PowerSystemConfig(Line_name=line_name,
49
- SubGeographicalRegion_name=subregion_name,
50
- GeographicalRegion_name=region_name)
51
- sim_config.power_system_configs.append(psc)
52
- sim_obj = Simulation(gapps=gadObj, run_config=sim_config)
53
- def on_measurement(sim, ts, m):
54
- global measurements_received
55
- measurements_received += 1
56
- def on_simulation_complete(sim):
57
- global simulation_is_complete
58
- simulation_is_complete = True
59
- sim_obj.add_onmeasurement_callback(on_measurement)
60
- sim_obj.add_oncomplete_callback(on_simulation_complete)
61
- sim_obj.start_simulation()
62
- while not simulation_is_complete:
63
- time.sleep(1)
64
- assert measurements_received == 1
65
- gadObj.disconnect()