Skip to content

Commit

Permalink
update python min requirements.
Browse files Browse the repository at this point in the history
Add default list for DERCurve and DERControl lists.
  • Loading branch information
craig8 committed May 9, 2024
1 parent df7a664 commit 370f17e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
29 changes: 17 additions & 12 deletions ieee_2030_5/server/server_constructs.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def create_device_capability(end_device_index: int) -> m.DeviceCapability:

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

def update_active_der_event_started(event: m.Event):
"""Event triggered when a DERControl event starts
Find the control and copy it to the ActiveDERControlList
:param event: The control event
Expand Down Expand Up @@ -125,7 +125,7 @@ def update_active_der_event_started(event: m.Event):

def update_active_der_event_ended(event: m.Event):
"""Event triggered when a DERControl event ends
Search over the ActiveDERControlListLink for the event that has been triggered
and remove it from the list.
Expand Down Expand Up @@ -165,23 +165,23 @@ def update_active_der_event_ended(event: m.Event):


def initialize_2030_5(config: ServerConfiguration, tlsrepo: TLSRepository):
"""Initialize the 2030.5 server.
"""Initialize the 2030.5 server.
This method initializes the adapters from the configuration objects into
the persistence adapters.
The adapters are:
- EndDeviceAdapter
- DERAdapter
- DERCurveAdapter
- DERProgramAdapter
- FunctionSetAssignmentsAdapter
The EndDevices in the EndDeviceAdapter will link to Lists of other types. Those
Lists will be stored in the ListAdapter object under the List's href (see below /edev_0_der).
As an example the following, note the DER href is not /edev_0_der_0, but /der_12 instead.
<EndDevice href="/edev_0">
<DERList href="/edev_0_der" all="1">
</EndDevice>
Expand All @@ -190,8 +190,8 @@ def initialize_2030_5(config: ServerConfiguration, tlsrepo: TLSRepository):
...
</DER>
</DERList
"""
_log.debug("Initializing 2030.5")
_log.debug("Adding server level urls to cache")
Expand Down Expand Up @@ -227,8 +227,13 @@ def initialize_2030_5(config: ServerConfiguration, tlsrepo: TLSRepository):
else:
default_der_control.DERControlBase = m.DERControlBase(**der_control_base)
adpt.ListAdapter.initialize_uri(program.DERControlListLink.href, m.DERControl)


add_href(program.DefaultDERControlLink.href, default_der_control)
add_href(program.ActiveDERControlListLink.href, m.DERControlList(DERControl=[]))
add_href(program.DERCurveListLink.href, m.DERCurveList(DERCurve=[]))
add_href(program.DERControlListLink.href, m.DERControlList(DERControl=[]))


programs_by_description[program.description] = program

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ documentation = "https://github.com/GRIDAPPSD/gridappsd-2030_5"


[tool.poetry.dependencies]
python = "^3.8"
python = "^3.8.1,<4.0"
pvlib = "^0.9.0"
# gridappsd-python = {path = "../gridappsd-python", develop = true}
Flask = "^2.0.3"
Expand All @@ -31,12 +31,13 @@ flask-talisman = "^1.0.0"
blinker = "^1.5"
nicegui = "^1.3.5"
# cim-graph = "^2023.5.1a3"
# gridappsd-field-bus = "^2023.5"
#gridappsd-field-bus = "^2024.4.0a0"
click = "^8.1.3"
flask-session = "^0.5.0"
xsdata = {extras = ["lxml"], version = "^23.8"}


pyyaml = "^6.0.1"
[tool.poetry.group.dev.dependencies]
m2r2 = "^0.3.2"
pytest = "^7.1.3"
Expand Down

0 comments on commit 370f17e

Please sign in to comment.