honeybee_radiance.properties.model module

Model Radiance Properties.

class honeybee_radiance.properties.model.ModelRadianceProperties(host, sensor_grids=None, views=None)[source]

Bases: object

Radiance Properties for Honeybee Model.

Parameters

host – A honeybee_core Model object that hosts these properties.

Properties:
  • host

  • sensor_grids

  • views

  • modifiers

  • blk_modifiers

  • room_modifiers

  • face_modifiers

  • shade_modifiers

  • bsdf_modifiers

  • modifier_sets

  • global_modifier_set

  • dynamic_shade_groups

  • dynamic_subface_groups

  • shade_group_identifiers

  • subface_group_identifiers

  • has_sensor_grids

  • has_views

ToString()[source]
add_sensor_grid(sensor_grid)[source]

Add a SensorGrid to this model.

Parameters

sensor_grid – A SensorGrid to add to this model.

add_sensor_grids(sensor_grids)[source]

Add a list of SensorGrids to this model.

add_view(view)[source]

Add a View to this model.

Parameters

view – A View to add to this model.

add_views(views)[source]

Add a list of Views to this model.

apply_properties_from_dict(data)[source]

Apply the radiance properties of a dictionary to the host Model of this object.

Parameters

data – A dictionary representation of an entire honeybee-core Model. Note that this dictionary must have ModelRadianceProperties in order for this method to successfully apply the radiance properties.

check_all(raise_exception=True, detailed=False)[source]

Check all of the aspects of the Model radiance properties.

Parameters
  • raise_exception – Boolean to note whether a ValueError should be raised if any errors are found. If False, this method will simply return a text string with all errors that were found. (Default: True).

  • detailed – Boolean for whether the returned object is a detailed list of dicts with error info or a string with a message. (Default: False).

Returns

A text string with all errors that were found or a list if detailed is True. This string (or list) will be empty if no errors were found.

check_duplicate_modifier_identifiers(raise_exception=True, detailed=False)[source]

Check that there are no duplicate Modifier identifiers in the model.

Parameters
  • raise_exception – Boolean to note whether a ValueError should be raised if duplicate identifiers are found. (Default: True).

  • detailed – Boolean for whether the returned object is a detailed list of dicts with error info or a string with a message. (Default: False).

Returns

A string with the message or a list with a dictionary if detailed is True.

check_duplicate_modifier_set_identifiers(raise_exception=True, detailed=False)[source]

Check that there are no duplicate ModifierSet identifiers in the model.

Parameters
  • raise_exception – Boolean to note whether a ValueError should be raised if duplicate identifiers are found. (Default: True).

  • detailed – Boolean for whether the returned object is a detailed list of dicts with error info or a string with a message. (Default: False).

Returns

A string with the message or a list with a dictionary if detailed is True.

check_duplicate_sensor_grid_identifiers(raise_exception=True, detailed=False)[source]

Check that there are no duplicate SensorGrid identifiers in the model.

Parameters
  • raise_exception – Boolean to note whether a ValueError should be raised if duplicate identifiers are found. (Default: True).

  • detailed – Boolean for whether the returned object is a detailed list of dicts with error info or a string with a message. (Default: False).

Returns

A string with the message or a list with a dictionary if detailed is True.

check_duplicate_view_identifiers(raise_exception=True, detailed=False)[source]

Check that there are no duplicate View identifiers in the model.

Parameters
  • raise_exception – Boolean to note whether a ValueError should be raised if duplicate identifiers are found. (Default: True).

  • detailed – Boolean for whether the returned object is a detailed list of dicts with error info or a string with a message. (Default: False).

Returns

A string with the message or a list with a dictionary if detailed is True.

check_sensor_grid_rooms_in_model(raise_exception=True, detailed=False)[source]

Check that the room_identifiers of SenorGrids are in the model.

Parameters
  • raise_exception – Boolean to note whether a ValueError should be raised if SensorGrids reference Rooms that are not in the Model. (Default: True).

  • detailed – Boolean for whether the returned object is a detailed list of dicts with error info or a string with a message. (Default: False).

Returns

A string with the message or a list with a dictionary if detailed is True.

check_view_rooms_in_model(raise_exception=True, detailed=False)[source]

Check that the room_identifiers of Views are in the model.

Parameters
  • raise_exception – Boolean to note whether a ValueError should be raised if Views reference Rooms that are not in the Model. (Default: True).

  • detailed – Boolean for whether the returned object is a detailed list of dicts with error info or a string with a message. (Default: False).

Returns

A string with the message or a list with a dictionary if detailed is True.

static dump_properties_to_dict(modifiers=None, modifier_sets=None)[source]

Get a ModelRadianceProperties dictionary from arrays of Python objects.

Parameters
  • modifiers – A list or tuple of radiance modifier objects.

  • modifier_sets – A list or tuple of modifier set objects.

Returns

A dictionary representation of ModelRadianceProperties. Note that

all objects in this dictionary will follow the abridged schema.

Return type

data

duplicate(new_host=None)[source]

Get a copy of this object.

new_host: A new Model object that hosts these properties.

If None, the properties will be duplicated with the same host.

faces_by_blk()[source]

Get all Faces in the model separated by their blk property.

This method will also ensure that any faces with Surface boundary condition are not duplicated in the result but are rather offset from the base face to ensure modifiers on opposite sides of interior Faces are accounted for. Furthermore, this method also ensures that any static interior sub-faces (with Surface boundary condition) only have one of such objects in the output lists.

Returns

  • faces: A list of all faces without a unique modifier_blk.

  • faces_blk: A list of all opaque faces that have a unique modifier_blk.

Return type

A tuple with 2 lists

static load_properties_from_dict(data)[source]

Load model radiance properties of a dictionary to Python objects.

Loaded objects include Modifiers and ModifierSets.

The function is called when re-serializing a Model object from a dictionary to load honeybee_radiance objects into their Python object form before applying them to the Model geometry.

Parameters

data – A dictionary representation of an entire honeybee-core Model. Note that this dictionary must have ModelRadianceProperties in order for this method to successfully load the radiance properties.

Returns

A tuple with two elements

  • modifiers: A dictionary with identifiers of modifiers as keys and Python modifier objects as values.

  • modifier_sets: A dictionary with identifiers of modifier sets as keys and Python modifier set objects as values.

move(moving_vec)[source]

Move all sensor_grid and view geometry along a vector.

Parameters

moving_vec – A ladybug_geometry Vector3D with the direction and distance to move the objects.

reflect(plane)[source]

Reflect all sensor_grid and view geometry across a plane.

Parameters

plane – A ladybug_geometry Plane across which the object will be reflected.

remove_sensor_grids()[source]

Remove all sensor grids from the model.

remove_views()[source]

Remove all views from the model.

rotate(axis, angle, origin)[source]

Rotate all sensor_grid and view geometry.

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)[source]

Rotate all sensor_grids and views counterclockwise in the world XY plane.

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)[source]

Scale all sensor_grid and view geometry by a factor.

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).

shades_by_blk()[source]

Get all Shades in the model separated by their blk property.

Dynamic shades will be excluded from the output lists.

Returns

  • shades: A list of all opaque shades without a unique modifier_blk (just using the default black or transparent modifier).

  • shades_blk: A list of all opaque shades that have a unique modifier_blk.

Return type

A tuple with 2 lists

subfaces_by_blk()[source]

Get model exterior sub-faces (Apertures, Doors) grouped by their blk property.

Dynamic sub-faces will be excluded from the output lists.

Returns

  • subfaces: A list of all sub-faces without a unique modifier_blk (just using the default black).

  • subfaces_blk: A list of all sub-faces that have a unique modifier_blk.

Return type

A tuple with 2 lists

to_dict()[source]

Return Model radiance properties as a dictionary.

property blk_modifiers

A list of all unique modifier_blk in the model.

This includes modifier_blk across all Faces, Apertures, Doors, and Shades. It also includes modifier_direct for any dynamic states assigned to these objects.

property bsdf_modifiers

A list of all unique BSDF modifiers in the model.

This includes any BSDF modifiers in both the Model.modifiers and the Model.blk_modifiers.

property dynamic_shade_groups

Get a list of DynamicShadeGroups in the model.

These can be used to write dynamic shades into radiance files.

property dynamic_subface_groups

Get a list of DynamicSubFaceGroups in the model.

These can be used to write dynamic Apertures and Doors into radiance files.

property face_modifiers

A list of all unique modifiers assigned to Faces, Apertures and Doors.

This includes both objects that are a part of Rooms as well as orphaned objects. It does not include the modifiers of any shades assigned to these objects. Nor does it include any blk modifiers.

property global_modifier_set

The global radiance modifier set.

This is what is used whenever no modifier has been assigned to a given Face/Aperture/Door/Shade and there is no modifier_set assigned to the parent Room.

property has_sensor_grids

Get a boolean for whether there are sensor grids assigned to the model.

property has_views

Get a boolean for whether there are views assigned to the model.

property host

Get the Model object hosting these properties.

property modifier_sets

A list of all unique Room-Assigned ModifierSets in the Model.

property modifiers

A list of all unique modifiers in the model.

This includes modifiers across all Faces, Apertures, Doors, Shades, Room ModifierSets, and modifiers for any dynamic states assigned to these objects.

However, it excludes modifiers in the default modifier set. It also excludes blk_modifiers and the modifier_direct of any states, which can be obtained separately from the blk_modifiers property.

property room_modifiers

A list of all unique modifiers assigned to Room ModifierSets.

property sensor_grids

Get or set an array of SensorGrids that are associated with the model.

property shade_group_identifiers

Get a list of identifiers for all the DynamicShadeGroups in the model.

property shade_modifiers

A list of all unique modifiers assigned to Shades in the model.

property subface_group_identifiers

Get a list of identifiers for all the DynamicSubFaceGroups in the model.

property views

Get or set an array of Views that are associated with the model.