Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"AUTOMOTIVE_FACILITY": "OTHER_NON_RESIDENTIAL",
"CONVENTION_CENTER": "PUBLIC_ASSEMBLY",
"COURTHOUSE": "OTHER_NON_RESIDENTIAL",
"DINING_BAR_LOUNGE_LEISURE": "OTHER_NON_RESIDENTIAL",
"DINING_CAFETERIA_FAST_FOOD": "OTHER_NON_RESIDENTIAL",
"DINING_FAMILY": "OTHER_NON_RESIDENTIAL",
"DORMITORY": "RESIDENTIAL",
"EXERCISE_CENTER": "OTHER_NON_RESIDENTIAL",
"FIRE_STATION": "OTHER_NON_RESIDENTIAL",
"GYMNASIUM": "PUBLIC_ASSEMBLY",
"HEALTH_CARE_CLINIC": "HOSPITAL",
"HOSPITAL": "HOSPITAL",
"HOTEL_MOTEL": "RESIDENTIAL",
"LIBRARY": "OTHER_NON_RESIDENTIAL",
"MANUFACTURING_FACILITY": "OTHER_NON_RESIDENTIAL",
"MOTION_PICTURE_THEATER": "PUBLIC_ASSEMBLY",
"MULTIFAMILY": "RESIDENTIAL",
"MUSEUM": "PUBLIC_ASSEMBLY",
"OFFICE": "OTHER_NON_RESIDENTIAL",
"PARKING_GARAGE": "HEATED-ONLY_STORAGE",
"PENITENTIARY": "OTHER_NON_RESIDENTIAL",
"PERFORMING_ARTS_THEATER": "PUBLIC_ASSEMBLY",
"POLICE_STATION": "OTHER_NON_RESIDENTIAL",
"POST_OFFICE": "OTHER_NON_RESIDENTIAL",
"RELIGIOUS_FACILITY": "PUBLIC_ASSEMBLY",
"RETAIL": "RETAIL",
"SCHOOL_UNIVERSITY": "OTHER_NON_RESIDENTIAL",
"SPORTS_ARENA": "PUBLIC_ASSEMBLY",
"TOWN_HALL": "OTHER_NON_RESIDENTIAL",
"TRANSPORTATION": "OTHER_NON_RESIDENTIAL",
"WAREHOUSE": "HEATED-ONLY_STORAGE",
"WORKSHOP": "OTHER_NON_RESIDENTIAL",
"NONE": "NONE"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"ATRIUM_LOW_MEDIUM": "OTHER_UNDETERMINED",
"ATRIUM_HIGH": "OTHER_UNDETERMINED",
"AUDIENCE_SEATING_AREA_AUDITORIUM": "PUBLIC_ASSEMBLY",
"AUDIENCE_SEATING_AREA_EXERCISE_CENTER": "OTHER_NON_RESIDENTIAL",
"AUDIENCE_SEATING_AREA_GYMNASIUM": "PUBLIC_ASSEMBLY",
"AUDIENCE_SEATING_AREA_MOTION_PICTURE_THEATER": "PUBLIC_ASSEMBLY",
"AUDIENCE_SEATING_AREA_PENITENTIARY": "OTHER_NON_RESIDENTIAL",
"AUDIENCE_SEATING_AREA_PERFORMING_ARTS_THEATER": "PUBLIC_ASSEMBLY",
"AUDIENCE_SEATING_AREA_RELIGIOUS_FACILITY": "PUBLIC_ASSEMBLY",
"AUDIENCE_SEATING_AREA_SPORTS_ARENA": "PUBLIC_ASSEMBLY",
"AUDIENCE_SEATING_AREA_TRANSPORTATION_FACILITY": "OTHER_NON_RESIDENTIAL",
"AUDIENCE_SEATING_AREA_ALL_OTHER": "PUBLIC_ASSEMBLY",
"AUDIENCE_SEATING_AREA_CONVENTION_CENTER": "PUBLIC_ASSEMBLY",
"BANKING_ACTIVITY_AREA": "OTHER_NON_RESIDENTIAL",
"CLASSROOM_LECTURE_HALL_TRAINING_ROOM_PENITENTIARY": "OTHER_NON_RESIDENTIAL",
"CLASSROOM_LECTURE_HALL_TRAINING_ROOM_SCHOOL": "OTHER_NON_RESIDENTIAL",
"CLASSROOM_LECTURE_HALL_TRAINING_ROOM_ALL_OTHER": "OTHER_NON_RESIDENTIAL",
"CONFERENCE_MEETING_MULTIPURPOSE_ROOM": "OTHER_NON_RESIDENTIAL",
"CONFINEMENT_CELLS": "OTHER_NON_RESIDENTIAL",
"COPY_PRINT_ROOM": "OTHER_UNDETERMINED",
"CORRIDOR_FACILITY_FOR_THE_VISUALLY_IMPAIRED": "OTHER_UNDETERMINED",
"CORRIDOR_HOSPITAL": "HOSPITAL",
"CORRIDOR_MANUFACTURING_FACILITY": "OTHER_NON_RESIDENTIAL",
"CORRIDOR_ALL_OTHERS": "OTHER_UNDETERMINED",
"COURT_ROOM": "OTHER_NON_RESIDENTIAL",
"COMPUTER_ROOM": "OTHER_UNDETERMINED",
"DINING_AREA_PENITENTIARY": "OTHER_NON_RESIDENTIAL",
"DINING_AREA_FACILITY_FOR_THE_VISUALLY_IMPAIRED": "OTHER_NON_RESIDENTIAL",
"DINING_AREA_BAR_LOUNGE_OR_LEISURE_DINING": "OTHER_NON_RESIDENTIAL",
"DINING_AREA_CAFETERIA_OR_FAST_FOOD_DINING": "OTHER_NON_RESIDENTIAL",
"DINING_AREA_FAMILY_DINING": "OTHER_NON_RESIDENTIAL",
"DINING_AREA_ALL_OTHERS": "OTHER_NON_RESIDENTIAL",
"ELECTRICAL_MECHANICAL_ROOM": "OTHER_UNDETERMINED",
"EMERGENCY_VEHICLE_GARAGE": "HEATED-ONLY_STORAGE",
"FOOD_PREPARATION_AREA": "OTHER_NON_RESIDENTIAL",
"GUEST_ROOM": "RESIDENTIAL",
"JUDGES_CHAMBERS": "OTHER_NON_RESIDENTIAL",
"DWELLING_UNIT": "RESIDENTIAL",
"LABORATORY_EXCEPT_IN_OR_AS_A_CLASSROOM": "OTHER_NON_RESIDENTIAL",
"LAUNDRY_WASHING_AREA": "OTHER_NON_RESIDENTIAL",
"LOADING_DOCK_INTERIOR": "HEATED-ONLY_STORAGE",
"LOBBY_FACILITY_FOR_THE_VISUALLY_IMPAIRED": "OTHER_NON_RESIDENTIAL",
"LOBBY_ELEVATOR": "OTHER_UNDETERMINED",
"LOBBY_HOTEL": "OTHER_NON_RESIDENTIAL",
"LOBBY_MOTION_PICTURE_THEATER": "PUBLIC_ASSEMBLY",
"LOBBY_PERFORMING_ARTS_THEATER": "PUBLIC_ASSEMBLY",
"LOBBY_ALL_OTHERS": "OTHER_UNDETERMINED",
"LOCKER_ROOM": "OTHER_UNDETERMINED",
"LOUNGE_BREAKROOM_HEALTH_CARE_FACILITY": "HOSPITAL",
"LOUNGE_BREAKROOM_ALL_OTHERS": "OTHER_NON_RESIDENTIAL",
"OFFICE_ENCLOSED": "OTHER_NON_RESIDENTIAL",
"OFFICE_OPEN_PLAN": "OTHER_NON_RESIDENTIAL",
"PARKING_AREA_INTERIOR": "HEATED-ONLY_STORAGE",
"PHARMACY_AREA": "OTHER_NON_RESIDENTIAL",
"RESTROOM_FACILITY_FOR_THE_VISUALLY_IMPAIRED": "OTHER_UNDETERMINED",
"RESTROOM_ALL_OTHERS": "OTHER_UNDETERMINED",
"SALES_AREA": "RETAIL",
"SEATING_AREA_GENERAL": "PUBLIC_ASSEMBLY",
"STAIRWELL": "OTHER_UNDETERMINED",
"STORAGE_ROOM_HOSPITAL": "HOSPITAL",
"STORAGE_ROOM_SMALL": "OTHER_UNDETERMINED",
"STORAGE_ROOM_LARGE": "OTHER_UNDETERMINED",
"VEHICULAR_MAINTENANCE_AREA": "HEATED_ONLY_STORAGE",
"ASSISTED_LIVING_FACILITY_CHAPEL": "PUBLIC_ASSEMBLY",
"ASSISTED_LIVING_FACILITY_RECREATION_ROOM_COMMON_LIVING_ROOM": "OTHER_NON_RESIDENTIAL",
"CONVENTION_CENTER_EXHIBIT_SPACE": "PUBLIC_ASSEMBLY",
"DORMITORY_LIVING_QUARTERS": "RESIDENTIAL",
"FIRE_STATION_SLEEPING_QUARTERS": "RESIDENTIAL",
"GYMNASIUM_FITNESS_CENTER_EXERCISE_AREA": "PUBLIC_ASSEMBLY",
"GYMNASIUM_FITNESS_CENTER_PLAYING_AREA": "PUBLIC_ASSEMBLY",
"HEALTHCARE_FACILITY_EMERGENCY_ROOM": "HOSPITAL",
"HEALTHCARE_FACILITY_EXAM_TREATMENT_ROOM": "HOSPITAL",
"HEALTHCARE_FACILITY_NURSERY": "HOSPITAL",
"HEALTHCARE_FACILITY_NURSES_STATION": "HOSPITAL",
"HEALTHCARE_FACILITY_OPERATING_ROOM": "HOSPITAL",
"HEALTHCARE_FACILITY_PATIENT_ROOM": "HOSPITAL",
"HEALTHCARE_FACILITY_PHYSICAL_THERAPY_ROOM": "HOSPITAL",
"HEALTHCARE_FACILITY_RECOVERY_ROOM": "HOSPITAL",
"LIBRARY_READING_AREA": "OTHER_NON_RESIDENTIAL",
"LIBRARY_STACKS": "OTHER_NON_RESIDENTIAL",
"MANUFACTURING_FACILITY_DETAILED_MANUFACTURING_AREA": "OTHER_NON_RESIDENTIAL",
"MANUFACTURING_FACILITY_EQUIPMENTROOM": "OTHER_NON_RESIDENTIAL",
"MANUFACTURING_FACILITY_EXTRA_HIGH_BAY_AREA": "OTHER_NON_RESIDENTIAL",
"MANUFACTURING_FACILITY_HIGH_BAY_AREA": "OTHER_NON_RESIDENTIAL",
"MANUFACTURING_FACILITY_LOW_BAY_AREA": "OTHER_NON_RESIDENTIAL",
"MUSEUM_GENERAL_EXHIBITION_AREA": "PUBLIC_ASSEMBLY",
"MUSEUM_RESTORATION_ROOM": "PUBLIC_ASSEMBLY",
"POST_OFFICE_SORTING_AREA": "OTHER_NON_RESIDENTIAL",
"RELIGIOUS_FACILITY_FELLOWSHIP_HALL": "PUBLIC_ASSEMBLY",
"RELIGIOUS_FACILITY_WORSHIP_PULPIT_CHOIR_AREA": "PUBLIC_ASSEMBLY",
"RETAIL_FACILITIES_DRESSING_FITTING_ROOM": "RETAIL",
"RETAIL_FACILITIES_MALL_CONCOURSE": "RETAIL",
"SPORTS_ARENA_PLAYING_AREA_CLASS_I_FACILITY": "PUBLIC_ASSEMBLY",
"SPORTS_ARENA_PLAYING_AREA_CLASS_II_FACILITY": "PUBLIC_ASSEMBLY",
"SPORTS_ARENA_PLAYING_AREA_CLASS_III_FACILITY": "PUBLIC_ASSEMBLY",
"SPORTS_ARENA_PLAYING_AREA_CLASS_IV_FACILITY": "PUBLIC_ASSEMBLY",
"TRANSPORTATION_FACILITY_BAGGAGE_CAROUSEL_AREA": "OTHER_NON_RESIDENTIAL",
"TRANSPORTATION_FACILITY_AIRPORT_CONCOURSE": "OTHER_NON_RESIDENTIAL",
"TRANSPORTATION_FACILITY_TICKET_COUNTER": "OTHER_NON_RESIDENTIAL",
"WAREHOUSE_STORAGE_AREA_MEDIUM_TO_BULKY_PALLETIZED_ITEMS": "HEATED_ONLY_STORAGE",
"WAREHOUSE_STORAGE_AREA_SMALLER_HAND_CARRIED_ITEMS": "HEATED_ONLY_STORAGE",
"NONE": "NONE"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from rct229.rulesets.ashrae9012022.data import data
from rct229.utils.assertions import assert_


def building_lighting_to_hvac_bat(lighting_bat):
bat_conversion_table = data["ashrae_90_1_lighting_to_hvac_map"]
assert_(
lighting_bat in bat_conversion_table,
f"Lighting area type {lighting_bat} does not exist in ashrae_90_1_lighting_to_hvac_map",
)
return bat_conversion_table[lighting_bat]


def space_lighting_to_hvac_bat(lighting_bat):
bat_conversion_table = data["ashrae_90_1_space_lighting_to_hvac_map"]
assert_(
lighting_bat in bat_conversion_table,
f"Lighting area type {lighting_bat} does not exist in ashrae_90_1_lighting_to_hvac_map",
)
return bat_conversion_table[lighting_bat]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from rct229.rulesets.ashrae9012022.data_fns.table_lighting_to_hvac_bat_map_fns import (
building_lighting_to_hvac_bat,
space_lighting_to_hvac_bat,
)


def test__lighting_to_hvac_bat__DORMITORY():
assert building_lighting_to_hvac_bat("DORMITORY") == "RESIDENTIAL"


def test__space_lighting_to_hvac_bat__ATRIUM_HIGH():
assert space_lighting_to_hvac_bat("ATRIUM_HIGH") == "OTHER_UNDETERMINED"
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
from typing import Optional, Type

from rct229.rulesets.ashrae9012022.ruleset_functions.baseline_systems.baseline_system_util import (
HVAC_SYS,
HVAC_SYSTEM_TYPE_DICTIONARY,
)
from rct229.utils.assertions import assert_


def baseline_system_type_compare(
system_type: HVAC_SYS,
target_system_type: HVAC_SYS,
exact_match: Optional[bool] = True,
) -> bool:
"""
Parameters
----------
system_type: String the enum indicating the hvac system type example: SYS_5 or SYS_8c.
This will usually be the value given by the function get_baseline_system_types
A None is acceptable and the function will raise RCTException which result in UNDETERMINED outcome.

target_system_type: String the enum indicating the target system type, will usually be SYS_# (primary baseline
system types) without a further number or letter modifier.

exact_match: Bool TRUE or FALSE. if exact_match is TRUE, then system_type must match exactly the enum given
by target_system_type. If false, an approximate match will return true. This would be used in the case where
the user wants any hvac system ot type 8, without having to type in 8a, 8b, 8c. In this case, SYS_8 would be
passed to the function and the function would return TRUE for any system 8, regardless of it's 8a, 8b, or 8c

Returns
-------
True or False, indicating whether the hvac system type matches the hvac_system_type.
"""

# A list of the available target system
available_target_system_list = HVAC_SYSTEM_TYPE_DICTIONARY
available_system_types = [
system
for key in HVAC_SYSTEM_TYPE_DICTIONARY
for system in HVAC_SYSTEM_TYPE_DICTIONARY[key]
]
available_system_types.extend(available_target_system_list)

assert_(
system_type in available_system_types,
f"{system_type} does not match any baseline HVAC system type",
)
assert_(
target_system_type in available_target_system_list,
f"{target_system_type} does not match any primary "
f"baseline HVAC system type",
)

return (
system_type == target_system_type
if exact_match
else system_type in HVAC_SYSTEM_TYPE_DICTIONARY[target_system_type]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
from rct229.schema.schema_enums import SchemaEnums
from rct229.utils.assertions import getattr_
from rct229.utils.jsonpath_utils import find_all
from rct229.utils.utility_functions import (
find_exactly_one_fluid_loop,
find_exactly_one_terminal_unit,
)

EXTERNAL_FLUID_SOURCE = SchemaEnums.schema_enums["ExternalFluidSourceOptions"]
FLUID_LOOP = SchemaEnums.schema_enums["FluidLoopOptions"]


def are_all_terminal_chw_loops_purchased_cooling(rmd_b, terminal_unit_id_list):
"""Returns TRUE if the fluid loop associated with the cooling_from_loop associated with each terminal unit is purchased CHW. Returns FALSE if this is not the case.
----------
rmd_b : json
RMD at RuleSetModelDescription level
terminal_unit_id_list : list
List of terminal units IDs
Returns
-------
bool
True: the fluid loop associated with the cooling_from_loop associated with each terminal unit is purchased CHW.
False: otherwise
"""
are_all_terminal_chw_loops_purchased_cooling_flag = True

# get the list of loop ids if the external fluid source matches to either hot water or steam
purchased_cooling_loop_id_list_b = find_all(
f'external_fluid_sources[*][?(@.type="{EXTERNAL_FLUID_SOURCE.CHILLED_WATER}")].loop',
rmd_b,
)

for terminal_b_id in terminal_unit_id_list:
terminal_b = find_exactly_one_terminal_unit(rmd_b, terminal_b_id)
cooling_from_loop_id = terminal_b.get("cooling_from_loop")
if cooling_from_loop_id:
fluid_loop = find_exactly_one_fluid_loop(rmd_b, cooling_from_loop_id)
if (
getattr_(fluid_loop, "fluid loop", "type") != FLUID_LOOP.COOLING
or cooling_from_loop_id not in purchased_cooling_loop_id_list_b
):
are_all_terminal_chw_loops_purchased_cooling_flag = False
break
else:
are_all_terminal_chw_loops_purchased_cooling_flag = False
break

return are_all_terminal_chw_loops_purchased_cooling_flag
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from rct229.schema.schema_enums import SchemaEnums
from rct229.utils.utility_functions import find_exactly_one_terminal_unit

COOLING_SOURCE = SchemaEnums.schema_enums["CoolingSourceOptions"]


def are_all_terminal_cool_sources_chilled_water(rmd_b, terminal_unit_id_list):
"""Returns TRUE if the cool source associated with all terminal units is CHILLED_WATER. It returns FALSE if any terminal unit has a cool source other than CHILLED_WATER.
----------
rmd_b : json
RMD at RuleSetModelDescription level
terminal_unit_id_list : list
List of terminal units IDs
Returns
-------
bool
True: cool source associated with all terminal units sent to this function is CHILLED_WATER
False: any terminal unit has a cool source other than CHILLED_WATER
"""
# all terminal cool sources should be chilled water, false otherwise
return all(
find_exactly_one_terminal_unit(rmd_b, terminal_b_id).get("cooling_source")
== COOLING_SOURCE.CHILLED_WATER
for terminal_b_id in terminal_unit_id_list
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from rct229.schema.schema_enums import SchemaEnums
from rct229.utils.utility_functions import find_exactly_one_terminal_unit

COOLING_SOURCE = SchemaEnums.schema_enums["CoolingSourceOptions"]


def are_all_terminal_cool_sources_none_or_null(rmd_b, terminal_unit_id_list):
"""Returns TRUE if the cool source associated with all terminal units input to this function are None or Null. It returns FALSE if any terminal unit has a cool source other than None or Null.
----------
rmd_b : json
RMD at RuleSetModelDescription level
terminal_unit_id_list : list
List of terminal units IDs
Returns
-------
bool
True: the cool source associated with all terminal units input to this function are None or Null
False: any terminal unit has a cool source other than None or Null
"""
are_all_terminal_cool_sources_none_or_null_flag = True
for terminal_b_id in terminal_unit_id_list:
terminal_b = find_exactly_one_terminal_unit(rmd_b, terminal_b_id)
if terminal_b.get("cooling_source") not in [None, COOLING_SOURCE.NONE]:
are_all_terminal_cool_sources_none_or_null_flag = False
break

return are_all_terminal_cool_sources_none_or_null_flag
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from rct229.schema.schema_enums import SchemaEnums
from rct229.utils.utility_functions import find_exactly_one_terminal_unit

TERMINAL_FAN_CONFIGURATION = SchemaEnums.schema_enums["TerminalFanConfigurationOptions"]


def are_all_terminal_fan_configs_parallel(rmd_b, terminal_unit_id_list):
"""Returns TRUE if the fan configuration associated with all terminal units input to this function are parallel.
It returns FALSE if any terminal unit has a fan configuration other than parallel.

----------
rmd_b : json
RMD at RuleSetModelDescription level
terminal_unit_id_list : list
List of terminal units IDs
Returns
-------
bool
True: fan configuration associated with all terminal units input to this function are parallel
False: any terminal unit has a fan configuration other than parallel
"""
# all terminal's fan configuration should be parallel, and false otherwise.
return all(
find_exactly_one_terminal_unit(rmd_b, terminal_b_id).get("fan_configuration")
== TERMINAL_FAN_CONFIGURATION.PARALLEL
for terminal_b_id in terminal_unit_id_list
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from rct229.utils.utility_functions import find_exactly_one_terminal_unit


def are_all_terminal_fans_null(rmd_b, terminal_unit_id_list):
"""Returns TRUE if the fan data element associated with all terminal units input to this function are equal to Null. It returns FALSE if any terminal unit has a fan data element not equal to Null.
----------
rmd_b : json
RMD at RuleSetModelDescription level
terminal_unit_id_list : list
List of terminal units IDs
Returns
-------
bool
True: fan data element associated with all terminal units input to this function are equal to Null
False: any terminal unit has a fan data element not equal to Null.
"""
are_all_terminal_fans_null_flag = True
for terminal_b_id in terminal_unit_id_list:
terminal_b = find_exactly_one_terminal_unit(rmd_b, terminal_b_id)
if terminal_b.get("fan") is not None:
are_all_terminal_fans_null_flag = False
break

return are_all_terminal_fans_null_flag
Loading
Loading