Skip to content

Commit 370f17e

Browse files
committed
update python min requirements.
Add default list for DERCurve and DERControl lists.
1 parent df7a664 commit 370f17e

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

ieee_2030_5/server/server_constructs.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ def create_device_capability(end_device_index: int) -> m.DeviceCapability:
4141

4242
def add_enddevice(device: m.EndDevice) -> m.EndDevice:
4343
"""Populates links to EndDevice resources and adds it to the EndDeviceAdapter.
44-
44+
4545
If the link is to a single writable (by the client) resource then create the link
4646
and the resource with default data. Otherwise, the link will be to a list. It is
4747
expected that the list will be populated at a later point in time in the code execution.
48-
48+
4949
The enddevice is added to the enddevice adapter, and the following links are created and added to the enddevice:
5050
5151
- `DERListLink`: A link to the DER list for the enddevice
@@ -89,7 +89,7 @@ def add_enddevice(device: m.EndDevice) -> m.EndDevice:
8989

9090
def update_active_der_event_started(event: m.Event):
9191
"""Event triggered when a DERControl event starts
92-
92+
9393
Find the control and copy it to the ActiveDERControlList
9494
9595
:param event: The control event
@@ -125,7 +125,7 @@ def update_active_der_event_started(event: m.Event):
125125

126126
def update_active_der_event_ended(event: m.Event):
127127
"""Event triggered when a DERControl event ends
128-
128+
129129
Search over the ActiveDERControlListLink for the event that has been triggered
130130
and remove it from the list.
131131
@@ -165,23 +165,23 @@ def update_active_der_event_ended(event: m.Event):
165165

166166

167167
def initialize_2030_5(config: ServerConfiguration, tlsrepo: TLSRepository):
168-
"""Initialize the 2030.5 server.
169-
168+
"""Initialize the 2030.5 server.
169+
170170
This method initializes the adapters from the configuration objects into
171171
the persistence adapters.
172-
172+
173173
The adapters are:
174-
174+
175175
- EndDeviceAdapter
176176
- DERAdapter
177177
- DERCurveAdapter
178178
- DERProgramAdapter
179179
- FunctionSetAssignmentsAdapter
180-
180+
181181
The EndDevices in the EndDeviceAdapter will link to Lists of other types. Those
182182
Lists will be stored in the ListAdapter object under the List's href (see below /edev_0_der).
183183
As an example the following, note the DER href is not /edev_0_der_0, but /der_12 instead.
184-
184+
185185
<EndDevice href="/edev_0">
186186
<DERList href="/edev_0_der" all="1">
187187
</EndDevice>
@@ -190,8 +190,8 @@ def initialize_2030_5(config: ServerConfiguration, tlsrepo: TLSRepository):
190190
...
191191
</DER>
192192
</DERList
193-
194-
193+
194+
195195
"""
196196
_log.debug("Initializing 2030.5")
197197
_log.debug("Adding server level urls to cache")
@@ -227,8 +227,13 @@ def initialize_2030_5(config: ServerConfiguration, tlsrepo: TLSRepository):
227227
else:
228228
default_der_control.DERControlBase = m.DERControlBase(**der_control_base)
229229
adpt.ListAdapter.initialize_uri(program.DERControlListLink.href, m.DERControl)
230+
231+
230232
add_href(program.DefaultDERControlLink.href, default_der_control)
231233
add_href(program.ActiveDERControlListLink.href, m.DERControlList(DERControl=[]))
234+
add_href(program.DERCurveListLink.href, m.DERCurveList(DERCurve=[]))
235+
add_href(program.DERControlListLink.href, m.DERControlList(DERControl=[]))
236+
232237

233238
programs_by_description[program.description] = program
234239

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ documentation = "https://github.com/GRIDAPPSD/gridappsd-2030_5"
1313

1414

1515
[tool.poetry.dependencies]
16-
python = "^3.8"
16+
python = "^3.8.1,<4.0"
1717
pvlib = "^0.9.0"
1818
# gridappsd-python = {path = "../gridappsd-python", develop = true}
1919
Flask = "^2.0.3"
@@ -31,12 +31,13 @@ flask-talisman = "^1.0.0"
3131
blinker = "^1.5"
3232
nicegui = "^1.3.5"
3333
# cim-graph = "^2023.5.1a3"
34-
# gridappsd-field-bus = "^2023.5"
34+
#gridappsd-field-bus = "^2024.4.0a0"
3535
click = "^8.1.3"
3636
flask-session = "^0.5.0"
3737
xsdata = {extras = ["lxml"], version = "^23.8"}
3838

3939

40+
pyyaml = "^6.0.1"
4041
[tool.poetry.group.dev.dependencies]
4142
m2r2 = "^0.3.2"
4243
pytest = "^7.1.3"

0 commit comments

Comments
 (0)