From f8c880a05e53a7bd55b4aec97bc4b8b01814ea04 Mon Sep 17 00:00:00 2001 From: Jessica Millar Date: Sun, 15 Dec 2024 09:03:54 -0500 Subject: [PATCH] Update ActorClass w PumpDoctor & DefrostManager --- src/gwproto/enums/__init__.py | 6 +--- src/gwproto/enums/actor_class.py | 6 +++- src/gwproto/enums/market_price_unit.py | 34 --------------------- src/gwproto/enums/market_quantity_unit.py | 36 ----------------------- tests/enums/actor_class_test.py | 6 ++-- tests/enums/market_price_unit_test.py | 15 ---------- tests/enums/market_quantity_unit_test.py | 16 ---------- 7 files changed, 10 insertions(+), 109 deletions(-) delete mode 100644 src/gwproto/enums/market_price_unit.py delete mode 100644 src/gwproto/enums/market_quantity_unit.py delete mode 100644 tests/enums/market_price_unit_test.py delete mode 100644 tests/enums/market_quantity_unit_test.py diff --git a/src/gwproto/enums/__init__.py b/src/gwproto/enums/__init__.py index d8f97f59..1602f931 100644 --- a/src/gwproto/enums/__init__.py +++ b/src/gwproto/enums/__init__.py @@ -52,8 +52,6 @@ from gwproto.enums.hz_calc_method import HzCalcMethod from gwproto.enums.kind_of_param import KindOfParam from gwproto.enums.make_model import MakeModel -from gwproto.enums.market_price_unit import MarketPriceUnit -from gwproto.enums.market_quantity_unit import MarketQuantityUnit from gwproto.enums.primary_pump_control import PrimaryPumpControl from gwproto.enums.relay_closed_or_open import RelayClosedOrOpen from gwproto.enums.relay_energization_state import RelayEnergizationState @@ -67,7 +65,7 @@ from gwproto.enums.unit import Unit __all__ = [ - "ActorClass", # [sh.actor.class.004](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#shactorclass) + "ActorClass", # [sh.actor.class.005](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#shactorclass) "AdminEvent", # [admin.event.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#adminevent) "AdminState", # [admin.state.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#adminstate) "AlertPriority", # [alert.priority.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#alertpriority) @@ -89,8 +87,6 @@ "HzCalcMethod", # [hz.calc.method.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#hzcalcmethod) "KindOfParam", # [spaceheat.kind.of.param.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#spaceheatkindofparam) "MakeModel", # [spaceheat.make.model.004](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#spaceheatmakemodel) - "MarketPriceUnit", # [market.price.unit.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#marketpriceunit) - "MarketQuantityUnit", # [market.quantity.unit.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#marketquantityunit) "PrimaryPumpControl", # [primary.pump.control.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#primarypumpcontrol) "RelayClosedOrOpen", # [relay.closed.or.open.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#relayclosedoropen) "RelayEnergizationState", # [relay.energization.state.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#relayenergizationstate) diff --git a/src/gwproto/enums/actor_class.py b/src/gwproto/enums/actor_class.py index 9bf6068f..103dd2d3 100644 --- a/src/gwproto/enums/actor_class.py +++ b/src/gwproto/enums/actor_class.py @@ -73,6 +73,8 @@ class ActorClass(GwStrEnum): - AtomicAlly: Direct report of Atn when the Scada is in Atn mode. - SynthGenerator - FakeAtn + - PumpDoctor: An actor that monitors and resets pumps if necessary + - DefrostManager: Actor that handles the defrost cycle of a heat pump. For more information: - [ASLs](https://gridworks-type-registry.readthedocs.io/en/latest/) @@ -108,6 +110,8 @@ class ActorClass(GwStrEnum): AtomicAlly = auto() SynthGenerator = auto() FakeAtn = auto() + PumpDoctor = auto() + DefrostManager = auto() @classmethod def default(cls) -> "ActorClass": @@ -123,4 +127,4 @@ def enum_name(cls) -> str: @classmethod def enum_version(cls) -> str: - return "004" + return "005" diff --git a/src/gwproto/enums/market_price_unit.py b/src/gwproto/enums/market_price_unit.py deleted file mode 100644 index b43cbd9b..00000000 --- a/src/gwproto/enums/market_price_unit.py +++ /dev/null @@ -1,34 +0,0 @@ -from enum import auto -from typing import List - -from gw.enums import GwStrEnum - - -class MarketPriceUnit(GwStrEnum): - """ - Price unit assigned to MarketMaker MarketType - Values: - - USDPerMWh - - For more information: - - [ASLs](https://gridworks-type-registry.readthedocs.io/en/latest/) - - [Global Authority](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#marketpriceunit) - """ - - USDPerMWh = auto() - - @classmethod - def default(cls) -> "MarketPriceUnit": - return cls.USDPerMWh - - @classmethod - def values(cls) -> List[str]: - return [elt.value for elt in cls] - - @classmethod - def enum_name(cls) -> str: - return "market.price.unit" - - @classmethod - def enum_version(cls) -> str: - return "000" diff --git a/src/gwproto/enums/market_quantity_unit.py b/src/gwproto/enums/market_quantity_unit.py deleted file mode 100644 index d88e1a0f..00000000 --- a/src/gwproto/enums/market_quantity_unit.py +++ /dev/null @@ -1,36 +0,0 @@ -from enum import auto -from typing import List - -from gw.enums import GwStrEnum - - -class MarketQuantityUnit(GwStrEnum): - """ - Quantity unit assigned to MarketMaker MarketType - Values: - - AvgMW - - AvgkW - - For more information: - - [ASLs](https://gridworks-type-registry.readthedocs.io/en/latest/) - - [Global Authority](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#marketquantityunit) - """ - - AvgMW = auto() - AvgkW = auto() - - @classmethod - def default(cls) -> "MarketQuantityUnit": - return cls.AvgMW - - @classmethod - def values(cls) -> List[str]: - return [elt.value for elt in cls] - - @classmethod - def enum_name(cls) -> str: - return "market.quantity.unit" - - @classmethod - def enum_version(cls) -> str: - return "000" diff --git a/tests/enums/actor_class_test.py b/tests/enums/actor_class_test.py index 014de16d..590f3fac 100644 --- a/tests/enums/actor_class_test.py +++ b/tests/enums/actor_class_test.py @@ -1,5 +1,5 @@ """ -Tests for enum sh.actor.class.004 from the GridWorks Type Registry. +Tests for enum sh.actor.class.005 from the GridWorks Type Registry. """ from gwproto.enums import ActorClass @@ -35,8 +35,10 @@ def test_actor_class() -> None: "AtomicAlly", "SynthGenerator", "FakeAtn", + "PumpDoctor", + "DefrostManager", } assert ActorClass.default() == ActorClass.NoActor assert ActorClass.enum_name() == "sh.actor.class" - assert ActorClass.enum_version() == "004" + assert ActorClass.enum_version() == "005" diff --git a/tests/enums/market_price_unit_test.py b/tests/enums/market_price_unit_test.py deleted file mode 100644 index 32cb399f..00000000 --- a/tests/enums/market_price_unit_test.py +++ /dev/null @@ -1,15 +0,0 @@ -""" -Tests for enum market.price.unit.000 from the GridWorks Type Registry. -""" - -from gwproto.enums import MarketPriceUnit - - -def test_market_price_unit() -> None: - assert set(MarketPriceUnit.values()) == { - "USDPerMWh", - } - - assert MarketPriceUnit.default() == MarketPriceUnit.USDPerMWh - assert MarketPriceUnit.enum_name() == "market.price.unit" - assert MarketPriceUnit.enum_version() == "000" diff --git a/tests/enums/market_quantity_unit_test.py b/tests/enums/market_quantity_unit_test.py deleted file mode 100644 index bdf0f77d..00000000 --- a/tests/enums/market_quantity_unit_test.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -Tests for enum market.quantity.unit.000 from the GridWorks Type Registry. -""" - -from gwproto.enums import MarketQuantityUnit - - -def test_market_quantity_unit() -> None: - assert set(MarketQuantityUnit.values()) == { - "AvgMW", - "AvgkW", - } - - assert MarketQuantityUnit.default() == MarketQuantityUnit.AvgMW - assert MarketQuantityUnit.enum_name() == "market.quantity.unit" - assert MarketQuantityUnit.enum_version() == "000"