Skip to content

Commit 2c8dfda

Browse files
committed
feat(comparison): Add properties for dragonfly-comparison extension
1 parent c847c01 commit 2c8dfda

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Dragonfly objects specific to comparison with other models."""
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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'

dragonfly_schema/model.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from .radiance.properties import Room2DRadiancePropertiesAbridged, \
2323
StoryRadiancePropertiesAbridged, BuildingRadiancePropertiesAbridged, \
2424
ContextShadeRadiancePropertiesAbridged, ModelRadianceProperties
25+
from .comparison.properties import Room2DComparisonProperties, ModelComparisonProperties
2526

2627

2728
class Room2DPropertiesAbridged(BaseModel):
@@ -36,6 +37,10 @@ class Room2DPropertiesAbridged(BaseModel):
3637
default=None
3738
)
3839

40+
comparison: Room2DComparisonProperties = Field(
41+
default=None
42+
)
43+
3944

4045
class Room2D(IDdBaseModel):
4146

@@ -398,6 +403,10 @@ class ModelProperties(BaseModel):
398403
default=None
399404
)
400405

406+
comparison: ModelComparisonProperties = Field(
407+
default=None
408+
)
409+
401410

402411
class Model(IDdBaseModel):
403412

0 commit comments

Comments
 (0)