fairyfly.properties module¶
Extension properties for Model, Shape, Boundary.
These objects hold all attributes assigned by extensions like fairyfly-therm. Note that these Property objects are not intended to exist on their own and should have a host object.
- class fairyfly.properties.BoundaryProperties(host)[source]¶
Bases:
_PropertiesFairyfly Boundary Properties.
This class will be extended by extensions.
Usage:
boundary = Boundary(geometry) boundary.properties -> BoundaryProperties boundary.properties.therm -> BoundaryThermProperties
- ToString()¶
Overwrite .NET ToString method.
- is_equivalent(other_properties)¶
Get a dictionary noting the equivalency of these properties to other ones.
The keys of this dictionary will note the name of each extension (eg. therm) and the values will be a boolean for whether the extension properties are equivalent or not.
- Parameters:
other_properties – Properties of another object for which equivalency will be tested.
- 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(axis, angle, origin)¶
Apply a rotation transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be rotated alongside the host object.
- Parameters:
axis – A ladybug_geometry Vector3D axis representing the axis of rotation.
angle – An angle for rotation in degrees.
origin – A ladybug_geometry Point3D for the origin around which the object will be rotated.
- rotate_xy(angle, origin)¶
Apply a rotation 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 fairyfly.properties.ModelProperties(host)[source]¶
Bases:
_PropertiesFairyfly Model Properties.
This class will be extended by extensions.
Usage:
model = Model(list_of_shapes, list_of_boundaries) model.properties -> ModelProperties model.properties.therm -> ModeThermProperties
- 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 fairyfly-core Model.
- is_equivalent(other_properties)¶
Get a dictionary noting the equivalency of these properties to other ones.
The keys of this dictionary will note the name of each extension (eg. therm) and the values will be a boolean for whether the extension properties are equivalent or not.
- Parameters:
other_properties – Properties of another object for which equivalency will be tested.
- 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(axis, angle, origin)¶
Apply a rotation transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be rotated alongside the host object.
- Parameters:
axis – A ladybug_geometry Vector3D axis representing the axis of rotation.
angle – An angle for rotation in degrees.
origin – A ladybug_geometry Point3D for the origin around which the object will be rotated.
- rotate_xy(angle, origin)¶
Apply a rotation 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.
- property host¶
Get the object hosting these properties.
- class fairyfly.properties.ShapeProperties(host)[source]¶
Bases:
_PropertiesFairyfly Shape Properties.
This class will be extended by extensions.
Usage:
shape = Shape('South Bedroom Wall', geometry) shape.properties -> ShapeProperties shape.properties.therm -> ShapeThermProperties
- ToString()¶
Overwrite .NET ToString method.
- is_equivalent(other_properties)¶
Get a dictionary noting the equivalency of these properties to other ones.
The keys of this dictionary will note the name of each extension (eg. therm) and the values will be a boolean for whether the extension properties are equivalent or not.
- Parameters:
other_properties – Properties of another object for which equivalency will be tested.
- 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.
- reset_to_default()[source]¶
Reset the extension properties assigned at the level of this Shape to default.
- rotate(axis, angle, origin)¶
Apply a rotation transform to extension attributes.
This is useful in cases where extension attributes possess geometric data that should be rotated alongside the host object.
- Parameters:
axis – A ladybug_geometry Vector3D axis representing the axis of rotation.
angle – An angle for rotation in degrees.
origin – A ladybug_geometry Point3D for the origin around which the object will be rotated.
- rotate_xy(angle, origin)¶
Apply a rotation 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.