preheat_open.building.Building¶
- class preheat_open.building.Building(location_id)¶
Bases:
object
Building defines a building in the PreHEAT sense
- __init__(location_id)¶
Methods
__init__
(location_id)Clears the comfort profile data loaded in the building object
Clears all data in the units of the object
clear_device_data
()describe
([display])- rtype:
str
describe_devices
([display])- rtype:
str
- rtype:
list
[dict
[str
,Union
[str
,float
,None
]]]
- rtype:
dict
get_comfort_profile_data
([comfort_profile_id])Accessor to the comfort profile data for a given comfort_profile_id.
- rtype:
list
DEPRECATED: use the 'unit_graph' attribute instead
get_zone
(id)- type id:
int
get_zones
(zone_ids)- type zone_ids:
iterate_units
()- rtype:
list
[BaseBuildingUnit
]
list_all_units
()- rtype:
list
[Unit
]
load_comfort_profile_data
(start, end)Loads the comfort profile data in the building object
load_data
(start, end[, resolution, components])Loads timeseries data in the units of a building
load_dataset
(component_map, start, end[, ...])- type component_map:
load_device_data
(start, end[, resolution])Loads the devices structure for the building (raw sensor structure)
qu
(*args, **kwargs)Convenience version of the query_units method
query_devices
([name, id, device_type])- rtype:
list
[Device
]
query_units
([unit_type, name, unit_id, ...])- type unit_type:
Optional
[str
]
query_zones
([zone_id, zone_type])- rtype:
list
[Zone
]
Attributes
DEPRECATED: use the 'unit_graph' attribute instead
Convenience accessor to the comfort profile data for the building, if only one is defined.
devices
unit_graph
- property G: MultiDiGraph¶
DEPRECATED: use the ‘unit_graph’ attribute instead
- clear_comfort_profile_data()¶
Clears the comfort profile data loaded in the building object
- clear_data()¶
Clears all data in the units of the object
- Return type:
None
- Returns:
/
- property comfort_profile_data: DataFrame¶
Convenience accessor to the comfort profile data for the building, if only one is defined.
- Raise:
NoComfortProfileError if no data is loaded/available or if there are too many comfort profiles for the building
- get_all_component_details()¶
- Return type:
list
[dict
[str
,Union
[str
,float
,None
]]]- Returns:
- get_all_component_ids()¶
- Return type:
dict
- Returns:
- get_comfort_profile_data(comfort_profile_id=None)¶
Accessor to the comfort profile data for a given comfort_profile_id. This requires prior loading via the load_comfort_profile_data method.
- Parameters:
comfort_profile_id (
Optional
[int
]) – ID of the comfort profile, if None tries to access the only comfort profile in the building (for convenience in small buildings without zones) and fails if too many available- Raise:
NoComfortProfileError if no data is loaded or available
- Return type:
DataFrame
- Returns:
dictionary of comfort profiles (key=comfort profile ID, value=dataframe[setpoint, min, max, value])
- get_supply_points()¶
- Return type:
list
- Returns:
- get_unit_graph()¶
DEPRECATED: use the ‘unit_graph’ attribute instead
- Return type:
MultiDiGraph
- load_comfort_profile_data(start, end)¶
Loads the comfort profile data in the building object
- Parameters:
start (
Union
[str
,datetime
]) – start of the periodend (
Union
[str
,datetime
]) – end of the period
- Return type:
None
- load_data(start, end, resolution='hour', components=None, **kwargs)¶
Loads timeseries data in the units of a building
- Parameters:
start (
Union
[str
,datetime
]) – start time of the data loadingend (
Union
[str
,datetime
]) – end time of the loadingresolution (
Union
[str
,Enum
]) – resolution of the data to be loadedcomponents (
Optional
[dict
[str
,list
[str
]]]) – mapping of the data to be loaded (None to load everything), where the key is the unit type, and the value is a list of the components to load (None to load them all)
- Return type:
None
- Returns:
/
- load_dataset(component_map, start, end, resolution='hour', load_weather=True)¶
- Parameters:
component_map –
start (
Union
[str
,datetime
]) –end (
Union
[str
,datetime
]) –resolution (
str
) –load_weather (
bool
) –
- Return type:
DataFrame
- Returns:
- load_devices()¶
Loads the devices structure for the building (raw sensor structure)
- Return type:
None
- qu(*args, **kwargs)¶
Convenience version of the query_units method
- Parameters:
args –
kwargs –
- Return type:
Union
[BaseBuildingUnit
,list
[BaseBuildingUnit
]]- Returns:
- query_units(unit_type=None, name=None, unit_id=None, exclude_shared=False)¶
- Parameters:
unit_type (
Optional
[str
]) –name (
Optional
[str
]) –unit_id (
Optional
[int
]) –exclude_shared (
bool
) – if True, excludes shared units
- Return type:
list
[BaseBuildingUnit
]- Returns:
a list of the relevant units