From 3026b11c9c37d10f97a9e999a2c43d37452d20f8 Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Fri, 3 May 2024 17:13:50 -0700 Subject: [PATCH] feat(doe2): Document newly added properties for DOE-2 I don't think we necessarily need to expose these properties on the UI yet but, if people assign them, I do not want them to be lost as we send HBJSONs between different bindings. --- .github/workflows/ci.yaml | 2 +- honeybee_schema/doe2/__init__.py | 0 honeybee_schema/doe2/properties.py | 64 ++++++++++++++++++++++++++++++ honeybee_schema/model.py | 10 +++++ 4 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 honeybee_schema/doe2/__init__.py create mode 100644 honeybee_schema/doe2/properties.py diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1b75baf..6993437 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: name: Unit tests strategy: matrix: - python-version: ['3.7', '3.10'] + python-version: ['3.10'] os: [macos-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} diff --git a/honeybee_schema/doe2/__init__.py b/honeybee_schema/doe2/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/honeybee_schema/doe2/properties.py b/honeybee_schema/doe2/properties.py new file mode 100644 index 0000000..6e21b90 --- /dev/null +++ b/honeybee_schema/doe2/properties.py @@ -0,0 +1,64 @@ +"""Model DOE-2 properties.""" +from pydantic import Field, constr +from typing import Union + +from .._base import NoExtraBaseModel +from ..altnumber import Autocalculate + + +class RoomDoe2Properties(NoExtraBaseModel): + + type: constr(regex='^RoomDoe2Properties$') = \ + 'RoomDoe2Properties' + + assigned_flow: Union[Autocalculate, float] = Field( + Autocalculate(), + ge=0, + description='A number for the design supply air flow rate for the zone ' + 'the Room is assigned to (cfm). This establishes the minimum allowed ' + 'design air flow. Note that the actual design flow may be larger. If ' + 'Autocalculate, this parameter will not be written into the INP.' + ) + + flow_per_area: Union[Autocalculate, float] = Field( + Autocalculate(), + ge=0, + description='A number for the design supply air flow rate to the zone ' + 'per unit floor area (cfm/ft2). If Autocalculate, this parameter will ' + 'not be written into the INP.' + ) + + min_flow_ratio: Union[Autocalculate, float] = Field( + Autocalculate(), + ge=0, + le=1, + description='A number between 0 and 1 for the minimum allowable zone ' + 'air supply flow rate, expressed as a fraction of design flow rate. Applicable ' + 'to variable-volume type systems only. If Autocalculate, this parameter will ' + 'not be written into the INP.' + ) + + min_flow_per_area: Union[Autocalculate, float] = Field( + Autocalculate(), + ge=0, + description='A number for the minimum air flow per square foot of ' + 'floor area (cfm/ft2). This is an alternative way of specifying the ' + 'min_flow_ratio. If Autocalculate, this parameter will not be written ' + 'into the INP.' + ) + + hmax_flow_ratio: Union[Autocalculate, float] = Field( + Autocalculate(), + ge=0, + le=1, + description='A number between 0 and 1 for the ratio of the maximum (or fixed) ' + 'heating airflow to the cooling airflow. The specific meaning varies according ' + 'to the type of zone terminal. If Autocalculate, this parameter will ' + 'not be written into the INP.' + ) + + +class ModelDoe2Properties(NoExtraBaseModel): + + type: constr(regex='^ModelDoe2Properties$') = \ + 'ModelDoe2Properties' diff --git a/honeybee_schema/model.py b/honeybee_schema/model.py index 639b461..0f52c32 100644 --- a/honeybee_schema/model.py +++ b/honeybee_schema/model.py @@ -16,6 +16,8 @@ FaceRadiancePropertiesAbridged, RoomRadiancePropertiesAbridged, \ ModelRadianceProperties, ShadeMeshRadiancePropertiesAbridged +from .doe2.properties import RoomDoe2Properties, ModelDoe2Properties + from .geometry import Face3D, Mesh3D @@ -294,6 +296,10 @@ class RoomPropertiesAbridged(BaseModel): default=None ) + doe2: RoomDoe2Properties = Field( + default=None + ) + class Room(IDdBaseModel): @@ -368,6 +374,10 @@ class ModelProperties(BaseModel): default=None ) + doe2: ModelDoe2Properties = Field( + default=None + ) + class Model(IDdBaseModel):