preheat_open.zone.Zone

class preheat_open.zone.Zone(id=None, name='', type='', external_identifier='', area=None, has_external_wall=None, parent=None, sub_zones=None, units=None, adjacent_zones=None, comfort_profile_id=None, ventilation_information=None, location=None)

Bases: object

Defines a building zone in the PreHEAT sense.

Variables:
  • id (int | None) – The unique identifier of the zone.

  • name (str) – The name of the zone.

  • type (str) – The type of the zone.

  • external_identifier (str) – The external identifier of the zone.

  • area (float) – The area of the zone.

  • has_external_wall (bool) – Indicates if the zone has an external wall.

  • parent (Zone) – The parent zone.

  • sub_zones (list[Zone | Factory]) – A list of sub-zones or factories to create sub-zones.

  • units (list[Unit]) – A list of units associated with the zone.

  • adjacent_zones (list[int]) – A list of IDs of adjacent zones.

  • comfort_profile_id (int | None) – The ID of the comfort profile associated with the zone.

  • ventilation_information (VentilationInfo) – The ventilation information of the zone.

  • _zone_query_type (type) – The query type for zones.

__init__(id=None, name='', type='', external_identifier='', area=None, has_external_wall=None, parent=None, sub_zones=None, units=None, adjacent_zones=None, comfort_profile_id=None, ventilation_information=None, location=None)

Initialize Zone.

Parameters:
  • id (int | None) – The unique identifier of the zone

  • name (str) – The name of the zone

  • type (str) – The type of the zone

  • external_identifier (str) – The external identifier of the zone

  • area (float) – The area of the zone

  • has_external_wall (bool) – Indicates if the zone has an external wall

  • parent (Zone) – The parent zone

  • sub_zones (list[Zone | Factory]) – A list of sub-zones or factories to create sub-zones

  • units (list[Unit]) – A list of units associated with the zone

  • adjacent_zones (list[int]) – A list of IDs of adjacent zones

  • comfort_profile_id (int | None) – The ID of the comfort profile associated with the zone

  • ventilation_information (VentilationInfo) – The ventilation information of the zone

  • location (Location) – The location containing this zone

Methods

__init__([id, name, type, ...])

Initialize Zone.

from_building_model_dict(data)

Creates a Zone object from a building model dictionary.

get_comfort_profile(date_range)

Retrieves the comfort profile for the zone within the specified time range.

get_components([query])

Retrieves components associated with the device based on the specified query.

get_measurements(**kwargs)

Retrieves measurements for the device.

get_sub_zones([query, include_self])

Retrieves sub-zones associated with the zone based on the specified query.

get_units([query])

Retrieves sub-units associated with the unit based on the specified query.

to_building_model_dict()

Converts the Zone object to a dictionary for the building model.

classmethod from_building_model_dict(data)

Creates a Zone object from a building model dictionary.

Parameters:

data (dict) – The building model dictionary.

Returns:

A Zone object created from the building model dictionary.

Return type:

Zone

get_comfort_profile(date_range)

Retrieves the comfort profile for the zone within the specified time range.

Parameters:
  • start (datetime) – The start of the time range.

  • end (datetime) – The end of the time range.

Returns:

The comfort profile for the zone within the specified time range.

Return type:

ComfortProfile

get_components(query=None, **kwargs)

Retrieves components associated with the device based on the specified query.

Parameters:
  • query (Query | Sequence[Query] | None) – The query or list of queries to filter components.

  • include_self (bool) – Whether to include the device itself in the results if it matches the query.

  • kwargs – Additional keyword arguments for the query.

Returns:

A generator yielding components that match the query.

Return type:

Generator[Component, None, None]

get_measurements(**kwargs)

Retrieves measurements for the device.

Parameters:
  • start (datetime) – The start datetime for the measurements.

  • end (datetime) – The end datetime for the measurements.

  • components (list[Component] | Query | dict) – The components to get measurements for.

  • resolution (TimeResolution) – The time resolution for the measurements.

  • mapper (MapApplier) – The mapper to apply to the measurements.

Returns:

A DataFrame containing the measurements.

Return type:

pd.DataFrame

get_sub_zones(query=None, include_self=False, **kwargs)

Retrieves sub-zones associated with the zone based on the specified query.

Parameters:
  • query (Query | Sequence[Query] | None) – The query or list of queries to filter sub-zones.

  • include_self (bool) – Whether to include the zone itself in the results if it matches the query.

  • kwargs – Additional keyword arguments for the query.

Returns:

A generator yielding sub-zones that match the query.

Return type:

Generator[Zone, None, None]

get_units(query=None, **kwargs)

Retrieves sub-units associated with the unit based on the specified query.

Parameters:
  • query (Query | Sequence[Query] | None) – The query or list of queries to filter sub-units.

  • include_self (bool) – Whether to include the unit itself in the results if it matches the query.

  • kwargs – Additional keyword arguments for the query.

Returns:

A generator yielding sub-units that match the query.

Return type:

Generator[Unit, None, None]

to_building_model_dict()

Converts the Zone object to a dictionary for the building model.

Returns:

A dictionary representation of the Zone object.

Return type:

dict