Skip to content

Commit

Permalink
feat(doe2): Document newly added properties for DOE-2
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chriswmackey authored and Chris Mackey committed May 4, 2024
1 parent 059468e commit 3026b11
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Empty file.
64 changes: 64 additions & 0 deletions honeybee_schema/doe2/properties.py
Original file line number Diff line number Diff line change
@@ -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'
10 changes: 10 additions & 0 deletions honeybee_schema/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
FaceRadiancePropertiesAbridged, RoomRadiancePropertiesAbridged, \
ModelRadianceProperties, ShadeMeshRadiancePropertiesAbridged

from .doe2.properties import RoomDoe2Properties, ModelDoe2Properties

from .geometry import Face3D, Mesh3D


Expand Down Expand Up @@ -294,6 +296,10 @@ class RoomPropertiesAbridged(BaseModel):
default=None
)

doe2: RoomDoe2Properties = Field(
default=None
)


class Room(IDdBaseModel):

Expand Down Expand Up @@ -368,6 +374,10 @@ class ModelProperties(BaseModel):
default=None
)

doe2: ModelDoe2Properties = Field(
default=None
)


class Model(IDdBaseModel):

Expand Down

0 comments on commit 3026b11

Please sign in to comment.