dragonfly.properties module¶
Extension properties for Building, Story, Room2D.
These objects hold all attributes assigned by extensions like dragonfly-radiance and dragonfly-energy. Note that these Property objects are not intended to exist on their own but should have a host object.
- class dragonfly.properties.BuildingProperties(host)[source]¶
Bases:
_Properties
Dragonfly Building properties. This class will be extended by extensions.
Usage:
building = Building('Office Tower', unique_stories) building.properties -> BuildingProperties building.properties.radiance -> BuildingRadianceProperties building.properties.energy -> BuildingEnergyProperties
- ToString()¶
Overwrite .NET ToString method.
- add_prefix(prefix)[source]¶
Change the identifier of attributes unique to this object by adding a prefix.
Notably, this method only adds the prefix to extension attributes that must be unique to the Building and does not add the prefix to attributes that are shared across several Buildings.
- Parameters:
prefix – Text that will be inserted at the start of extension attribute identifiers.
- apply_properties_from_geojson_dict(data)[source]¶
Apply extension properties to a host Building from a geoJSON dictionary.
- Parameters:
data – A dictionary representation of a geoJSON feature properties. Specifically, this should be the “properties” key describing a Polygon or MultiPolygon object.
- move(moving_vec)¶
Apply a move transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be moved alongside the host object.
- Parameters:
moving_vec – A ladybug_geometry Vector3D with the direction and distance to move the face.
- reflect(plane)¶
Apply a reflection transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be reflected alongside the host object.
- Parameters:
plane – A ladybug_geometry Plane across which the object will be reflected.
- rotate_xy(angle, origin)¶
Apply a rotatation in the XY plane to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be rotated alongside the host object.
- Parameters:
angle – An angle in degrees.
origin – A ladybug_geometry Point3D for the origin around which the object will be rotated.
- scale(factor, origin=None)¶
Apply a scale transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be scaled alongside the host object.
- Parameters:
factor – A number representing how much the object should be scaled.
origin – A ladybug_geometry Point3D representing the origin from which to scale. If None, it will be scaled from the World origin (0, 0, 0).
- to_dict(abridged=False, include=None)[source]¶
Convert properties to dictionary.
- Parameters:
abridged – Boolean to note whether the full dictionary describing the object should be returned (False) or just an abridged version (True). Default: False.
include – A list of keys to be included in dictionary. If None all the available keys will be included.
- property host¶
Get the object hosting these properties.
- class dragonfly.properties.ContextShadeProperties(host)[source]¶
Bases:
_Properties
Dragonfly ContextShade properties. This class will be extended by extensions.
Usage:
canopy = ContextShade('Outdoor Canopy', canopy_geo) canopy.properties -> ContextShadeProperties canopy.properties.radiance -> ContextShadeRadianceProperties canopy.properties.energy -> ContextShadeEnergyProperties
- ToString()¶
Overwrite .NET ToString method.
- add_prefix(prefix)[source]¶
Change the identifier of attributes unique to this object by adding a prefix.
Notably, this method only adds the prefix to extension attributes that must be unique to the ContextShade and does not add the prefix to attributes that are shared across several ContextShades.
- Parameters:
prefix – Text that will be inserted at the start of extension attribute identifiers.
- from_honeybee(hb_properties)[source]¶
Transfer extension attributes from a Honeybee Shade to Dragonfly ContextShade.
This method should be called within the from_honeybee method.
- Parameters:
hb_properties – The properties of the honeybee Shade that is being translated to a Dragonfly ContextShade.
- move(moving_vec)¶
Apply a move transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be moved alongside the host object.
- Parameters:
moving_vec – A ladybug_geometry Vector3D with the direction and distance to move the face.
- reflect(plane)¶
Apply a reflection transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be reflected alongside the host object.
- Parameters:
plane – A ladybug_geometry Plane across which the object will be reflected.
- rotate_xy(angle, origin)¶
Apply a rotatation in the XY plane to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be rotated alongside the host object.
- Parameters:
angle – An angle in degrees.
origin – A ladybug_geometry Point3D for the origin around which the object will be rotated.
- scale(factor, origin=None)¶
Apply a scale transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be scaled alongside the host object.
- Parameters:
factor – A number representing how much the object should be scaled.
origin – A ladybug_geometry Point3D representing the origin from which to scale. If None, it will be scaled from the World origin (0, 0, 0).
- to_dict(abridged=False, include=None)[source]¶
Convert properties to dictionary.
- Parameters:
abridged – Boolean to note whether the full dictionary describing the object should be returned (False) or just an abridged version (True). Default: False.
include – A list of keys to be included in dictionary. If None all the available keys will be included.
- to_honeybee(host, is_mesh=False)[source]¶
Convert this ContextShade’s extension properties to honeybee Shade properties.
- Parameters:
host – A honeybee-core Shade object that hosts these properties.
is_mesh – Boolean to note whether the input host is a ShadeMesh as opposed to a regular Shade. (Default: False).
- property host¶
Get the object hosting these properties.
- class dragonfly.properties.ModelProperties(host)[source]¶
Bases:
_Properties
Dragonfly Model Properties. This class will be extended by extensions.
Usage:
model = Model('South Boston District', list_of_buildings) model.properties -> ModelProperties model.properties.radiance -> ModelRadianceProperties model.properties.energy -> ModelEnergyProperties
- ToString()¶
Overwrite .NET ToString method.
- apply_properties_from_dict(data)[source]¶
Apply extension properties from a Model dictionary to the host Model.
- Parameters:
data – A dictionary representation of an entire dragonfly-core Model.
- move(moving_vec)¶
Apply a move transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be moved alongside the host object.
- Parameters:
moving_vec – A ladybug_geometry Vector3D with the direction and distance to move the face.
- reflect(plane)¶
Apply a reflection transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be reflected alongside the host object.
- Parameters:
plane – A ladybug_geometry Plane across which the object will be reflected.
- rotate_xy(angle, origin)¶
Apply a rotatation in the XY plane to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be rotated alongside the host object.
- Parameters:
angle – An angle in degrees.
origin – A ladybug_geometry Point3D for the origin around which the object will be rotated.
- scale(factor, origin=None)¶
Apply a scale transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be scaled alongside the host object.
- Parameters:
factor – A number representing how much the object should be scaled.
origin – A ladybug_geometry Point3D representing the origin from which to scale. If None, it will be scaled from the World origin (0, 0, 0).
- to_dict(include=None)[source]¶
Convert properties to dictionary.
- Parameters:
include – A list of keys to be included in dictionary. If None all the available keys will be included.
- to_honeybee(host)[source]¶
Convert this Model’s extension properties to honeybee Model properties.
- Parameters:
host – A honeybee-core Model object that hosts these properties.
- property host¶
Get the object hosting these properties.
- class dragonfly.properties.Room2DProperties(host)[source]¶
Bases:
_Properties
Dragonfly Room2D properties. This class will be extended by extensions.
Usage:
room = Room2D('Office', geometry) room.properties -> Room2DProperties room.properties.radiance -> Room2DRadianceProperties room.properties.energy -> Room2DEnergyProperties
- ToString()¶
Overwrite .NET ToString method.
- add_prefix(prefix)[source]¶
Change the identifier of attributes unique to this object by adding a prefix.
Notably, this method only adds the prefix to extension attributes that must be unique to the Room2D (eg. single-room HVAC systems) and does not add the prefix to attributes that are shared across several Rooms2Ds (eg. ConstructionSets).
- Parameters:
prefix – Text that will be inserted at the start of extension attribute identifiers.
- from_honeybee(hb_properties)[source]¶
Transfer extension attributes from a Honeybee Room to Dragonfly Room2D.
This method should be called within the from_honeybee method.
- Parameters:
hb_properties – The properties of the honeybee Room that is being translated to a Dragonfly Room2D.
- move(moving_vec)¶
Apply a move transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be moved alongside the host object.
- Parameters:
moving_vec – A ladybug_geometry Vector3D with the direction and distance to move the face.
- reflect(plane)¶
Apply a reflection transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be reflected alongside the host object.
- Parameters:
plane – A ladybug_geometry Plane across which the object will be reflected.
- rotate_xy(angle, origin)¶
Apply a rotatation in the XY plane to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be rotated alongside the host object.
- Parameters:
angle – An angle in degrees.
origin – A ladybug_geometry Point3D for the origin around which the object will be rotated.
- scale(factor, origin=None)¶
Apply a scale transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be scaled alongside the host object.
- Parameters:
factor – A number representing how much the object should be scaled.
origin – A ladybug_geometry Point3D representing the origin from which to scale. If None, it will be scaled from the World origin (0, 0, 0).
- to_dict(abridged=False, include=None)[source]¶
Convert properties to dictionary.
- Parameters:
abridged – Boolean to note whether the full dictionary describing the object should be returned (False) or just an abridged version (True). Default: False.
include – A list of keys to be included in dictionary. If None all the available keys will be included.
- to_honeybee(host)[source]¶
Convert this Room2D’s extension properties to honeybee Room properties.
- Parameters:
host – A honeybee-core Room object that hosts these properties.
- property host¶
Get the object hosting these properties.
- class dragonfly.properties.StoryProperties(host)[source]¶
Bases:
_Properties
Dragonfly Story properties. This class will be extended by extensions.
Usage:
story = Story('Ground Floor Retail', room_2ds) story.properties -> StoryProperties story.properties.radiance -> StoryRadianceProperties story.properties.energy -> StoryEnergyProperties
- ToString()¶
Overwrite .NET ToString method.
- add_prefix(prefix)[source]¶
Change the identifier of attributes unique to this object by adding a prefix.
Notably, this method only adds the prefix to extension attributes that must be unique to the Story and does not add the prefix to attributes that are shared across several Stories.
- Parameters:
prefix – Text that will be inserted at the start of extension attribute identifiers.
- move(moving_vec)¶
Apply a move transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be moved alongside the host object.
- Parameters:
moving_vec – A ladybug_geometry Vector3D with the direction and distance to move the face.
- reflect(plane)¶
Apply a reflection transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be reflected alongside the host object.
- Parameters:
plane – A ladybug_geometry Plane across which the object will be reflected.
- rotate_xy(angle, origin)¶
Apply a rotatation in the XY plane to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be rotated alongside the host object.
- Parameters:
angle – An angle in degrees.
origin – A ladybug_geometry Point3D for the origin around which the object will be rotated.
- scale(factor, origin=None)¶
Apply a scale transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be scaled alongside the host object.
- Parameters:
factor – A number representing how much the object should be scaled.
origin – A ladybug_geometry Point3D representing the origin from which to scale. If None, it will be scaled from the World origin (0, 0, 0).
- to_dict(abridged=False, include=None)[source]¶
Convert properties to dictionary.
- Parameters:
abridged – Boolean to note whether the full dictionary describing the object should be returned (False) or just an abridged version (True). Default: False.
include – A list of keys to be included in dictionary. If None all the available keys will be included.
- property host¶
Get the object hosting these properties.