Skip to content

Commit

Permalink
feat(face): Add validator for AirWall boundary condition
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Jan 22, 2020
1 parent 7c76616 commit 03c2fb6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion honeybee_schema/model.py
@@ -1,5 +1,5 @@
"""Model schema and the 5 geometry objects that define it."""
from pydantic import BaseModel, Field, validator, constr, conlist
from pydantic import BaseModel, Field, validator, root_validator, constr, conlist
from typing import List, Union
from enum import Enum

Expand Down Expand Up @@ -247,6 +247,15 @@ def suface_bc_objects(cls, v):
'(Radiance, EnergyPlus).'
)

@root_validator
def chack_air_walls_are_interior(cls, values):
"""Check that all air wall faces have a Surface boundary condition."""
face_type, bc = values.get('face_type'), values.get('boundary_condition')
if face_type == 'AirWall':
assert bc.type == 'Surface', \
'AirWalls must have "Surface" boundary conditions.'
return values


class RoomPropertiesAbridged(BaseModel):

Expand Down

0 comments on commit 03c2fb6

Please sign in to comment.