Skip to content

Commit

Permalink
feat(description): Fix descriptions for a number of objects
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Jan 17, 2020
1 parent 45445d2 commit 0ddc72d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
24 changes: 15 additions & 9 deletions honeybee_schema/energy/properties.py
Expand Up @@ -23,16 +23,18 @@ class ShadeEnergyPropertiesAbridged(BaseModel):
type: constr(regex='^ShadeEnergyPropertiesAbridged$') = \
'ShadeEnergyPropertiesAbridged'

transmittance_schedule: str = Field(
construction: str = Field(
default=None,
min_length=1,
max_length=100,
description='Name of a ShadeConstruction to set the reflectance and '
'specularity of the Shade. If None, the construction is set by the'
'parent Room construction_set or the Model global_construction_set.'
'parent Room construction_set, the Model global_construction_set or '
'(in the case fo an orphaned shade) the EnergyPlus default of 0.2 '
'diffuse reflectance.'
)

construction: str = Field(
transmittance_schedule: str = Field(
default=None,
min_length=1,
max_length=100,
Expand Down Expand Up @@ -131,12 +133,12 @@ class RoomEnergyPropertiesAbridged(BaseModel):

electric_equipment: ElectricEquipmentAbridged = Field(
default=None,
description='ElectricEquipment object to describe the equipment usage.'
description='ElectricEquipment object to describe the electric equipment usage.'
)

gas_equipment: GasEquipmentAbridged = Field(
default=None,
description='GasEquipment object to describe the equipment usage.'
description='GasEquipment object to describe the gas equipment usage.'
)

infiltration: InfiltrationAbridged = Field(
Expand Down Expand Up @@ -168,7 +170,11 @@ class ModelEnergyProperties(BaseModel):
type: constr(regex='^ModelEnergyProperties$') = \
'ModelEnergyProperties'

terrain_type: TerrianTypes = TerrianTypes.city
terrain_type: TerrianTypes = Field(
default=TerrianTypes.city,
description='Text for the terrain in which the model sits. This is used '
'to determine the wind profile over the height of the rooms.'
)

global_construction_set: str = Field(
default=None,
Expand Down Expand Up @@ -202,14 +208,14 @@ class ModelEnergyProperties(BaseModel):
'materials needed to make the Model constructions.'
)

hvacs: List[IdealAirSystemAbridged] = Field(
hvacs: List[Union[IdealAirSystemAbridged]] = Field(
default=None,
description='List of all ProgramTypes in the Model.'
description='List of all HVAC systems in the Model.'
)

program_types: List[ProgramTypeAbridged] = Field(
default=None,
description='List of all HVAC systems in the Model.'
description='List of all ProgramTypes in the Model.'
)

schedules: List[Union[ScheduleRulesetAbridged, ScheduleFixedIntervalAbridged]] = Field(
Expand Down
19 changes: 12 additions & 7 deletions honeybee_schema/model.py
Expand Up @@ -71,9 +71,10 @@ def check_num_items(cls, v):

@validator('holes')
def check_num_items_holes(cls, v):
for pt_list in v:
for pt in pt_list:
assert len(pt) == 3, 'Number of floats must be 3 for (x, y, z).'
if v is not None:
for pt_list in v:
for pt in pt_list:
assert len(pt) == 3, 'Number of floats must be 3 for (x, y, z).'
return v


Expand Down Expand Up @@ -264,7 +265,9 @@ class RoomPropertiesAbridged(BaseModel):

type: constr(regex='^RoomPropertiesAbridged$') = 'RoomPropertiesAbridged'

energy: RoomEnergyPropertiesAbridged
energy: RoomEnergyPropertiesAbridged = Field(
default=None
)


class Room(NamedBaseModel):
Expand All @@ -277,7 +280,7 @@ class Room(NamedBaseModel):
description='Faces that together form the closed volume of a room.'
)

indoor_shades: List[Shade] = Field(
indoor_shades: List[Shade] = Field(
default=None,
description='Shades assigned to the interior side of this object '
'(eg. partitions, tables).'
Expand All @@ -298,7 +301,7 @@ class Room(NamedBaseModel):
multiplier: int = Field(
1,
ge=1,
description='Get or set an integer noting how many times this Room is repeated. '
description='An integer noting how many times this Room is repeated. '
'Multipliers are used to speed up the calculation when similar Rooms are '
'repeated more than once. Essentially, a given simulation with the '
'Room is run once and then the result is mutliplied by the multiplier.'
Expand All @@ -309,7 +312,9 @@ class ModelProperties(BaseModel):

type: constr(regex='^ModelProperties$') = 'ModelProperties'

energy: ModelEnergyProperties
energy: ModelEnergyProperties = Field(
default=None
)


class Model(NamedBaseModel):
Expand Down

0 comments on commit 0ddc72d

Please sign in to comment.