honeybee.checkdup module

Utilities to check whether there are any duplicate values in a list of ids.

honeybee.checkdup.check_duplicate_identifiers(objects_to_check, raise_exception=True, obj_name='', detailed=False, code='000000', extension='Core', error_type='Duplicate Object Identifier')[source]

Check whether there are duplicated identifiers across a list of objects.

Parameters
  • objects_to_check – A list of honeybee objects across which duplicate identifiers will be checked.

  • raise_exception – Boolean to note whether an exception should be raised if duplicated identifiers are found. (Default: True).

  • obj_name – An optional name for the object to be included in the error message. Fro example, ‘Room’, ‘Face’, ‘Aperture’.

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

  • code – Text for the error code. (Default: 0000).

  • extension – Text for the name of the Honeybee extension for which duplicate identifiers are being evaluated. (Default: Core).

  • error_type – Text for the type of error. This should be directly linked to the error code and should simply be a human-readable version of the error code. (Default: Unknown Error).

Returns

A message string indicating the duplicated identifiers (if detailed is False) or a list of dictionaries with information about the duplicated identifiers (if detailed is True). This string (or list) will be empty if no duplicates were found.

honeybee.checkdup.check_duplicate_identifiers_parent(objects_to_check, raise_exception=True, obj_name='', detailed=False, code='000000', extension='Core', error_type='Duplicate Object Identifier')[source]

Check whether there are duplicated identifiers across a list of objects.

The error message will include the identifiers of top-level parents in order to make it easier to find the duplicated objects in the model.

Parameters
  • objects_to_check – A list of honeybee objects across which duplicate identifiers will be checked. These objects must have the ability to have parents for this method to run correctly.

  • raise_exception – Boolean to note whether an exception should be raised if duplicated identifiers are found. (Default: True).

  • obj_name – An optional name for the object to be included in the error message. For example, ‘Room’, ‘Face’, ‘Aperture’.

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

  • code – Text for the error code. (Default: 0000).

  • extension – Text for the name of the Honeybee extension for which duplicate identifiers are being evaluated. (Default: Core).

  • error_type – Text for the type of error. This should be directly linked to the error code and should simply be a human-readable version of the error code. (Default: Unknown Error).

Returns

A message string indicating the duplicated identifiers (if detailed is False) or a list of dictionaries with information about the duplicated identifiers (if detailed is True). This string (or list) will be empty if no duplicates were found.