|
| 1 | +"""Model comparison properties.""" |
| 2 | +from pydantic import Field, constr, conlist |
| 3 | +from typing import List, Union |
| 4 | + |
| 5 | +from honeybee_schema._base import NoExtraBaseModel |
| 6 | + |
| 7 | +from ..window_parameter import SingleWindow, SimpleWindowArea, SimpleWindowRatio, \ |
| 8 | + RepeatingWindowRatio, RectangularWindows, DetailedWindows |
| 9 | +from ..skylight_parameter import GriddedSkylightArea, GriddedSkylightRatio, \ |
| 10 | + DetailedSkylights |
| 11 | + |
| 12 | + |
| 13 | +class Room2DComparisonProperties(NoExtraBaseModel): |
| 14 | + |
| 15 | + type: constr(regex='^Room2DComparisonProperties$') = \ |
| 16 | + 'Room2DComparisonProperties' |
| 17 | + |
| 18 | + floor_boundary: List[conlist(float, min_items=2, max_items=2)] = Field( |
| 19 | + None, |
| 20 | + min_items=3, |
| 21 | + description='A list of 2D points representing the outer boundary vertices of ' |
| 22 | + 'the Room2D to which the host Room2D is being compared. The list should ' |
| 23 | + 'include at least 3 points and each point should be a list of 2 (x, y) values.' |
| 24 | + ) |
| 25 | + |
| 26 | + floor_holes: List[conlist(conlist(float, min_items=2, max_items=2), min_items=3)] \ |
| 27 | + = Field( |
| 28 | + None, |
| 29 | + description='Optional list of lists with one list for each hole in the floor ' |
| 30 | + 'plate of the Room2D to which the host Room2D is being compared. Each hole ' |
| 31 | + 'should be a list of at least 2 points and each point a list ' |
| 32 | + 'of 2 (x, y) values. If None, it will be assumed that there are no ' |
| 33 | + 'holes in the floor plate.' |
| 34 | + ) |
| 35 | + |
| 36 | + comparison_windows: List[Union[ |
| 37 | + None, SingleWindow, SimpleWindowArea, SimpleWindowRatio, RepeatingWindowRatio, |
| 38 | + RectangularWindows, DetailedWindows |
| 39 | + ]] = Field( |
| 40 | + default=None, |
| 41 | + description='A list of WindowParameter objects that dictate the window ' |
| 42 | + 'geometries of the Room2D to which the host Room2D is being compared.' |
| 43 | + ) |
| 44 | + |
| 45 | + comparison_skylight: Union[ |
| 46 | + None, GriddedSkylightArea, GriddedSkylightRatio, DetailedSkylights |
| 47 | + ] = Field( |
| 48 | + default=None, |
| 49 | + description='A SkylightParameter object for the Room2D to which the host ' |
| 50 | + 'Room2D is being compared.' |
| 51 | + ) |
| 52 | + |
| 53 | + |
| 54 | +class ModelComparisonProperties(NoExtraBaseModel): |
| 55 | + |
| 56 | + type: constr(regex='^ModelComparisonProperties$') = 'ModelComparisonProperties' |
0 commit comments