Skip to content

Commit

Permalink
Merge pull request #1519 from pnnl/RCT/YJ/minor_fixes
Browse files Browse the repository at this point in the history
RCT/YJ/Remove .keys() & Add missing $
  • Loading branch information
weilixu authored Sep 6, 2024
2 parents 1c597c2 + 9ff232e commit 3878d5b
Show file tree
Hide file tree
Showing 44 changed files with 66 additions and 66 deletions.
4 changes: 2 additions & 2 deletions rct229/reports/ashrae9012019/ashrae901_2019_detail_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ def output_node(output_result, output_eval_list, output_outcome_dict):
if any(
[
key.startswith("INVALID_") and key.endswith("_CONTEXT")
for key in output_result.keys()
for key in output_result
]
):
evaluation_outcome["invalid_msg"] = "".join(
[output_result[key] for key in output_result.keys()]
[output_result[key] for key in output_result]
)
output_outcome_dict[RCTOutcomeLabel.UNDETERMINED] += 1
else:
Expand Down
2 changes: 1 addition & 1 deletion rct229/rule_engine/rule_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def get_context(self, rmds, data=None):
-------
RulesetModelTypes or str
The return value from self._get_context() when the context exists
in each RMD for which the correponding self.rmds_used flag is set;
in each RMD for which the corresponding self.rmds_used flag is set;
otherwise retrns a string such as "MISSING_BASELINE" that indicates all
the RMDs that are missing.
"""
Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/data_fns/table_8_4_4_fns.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def table_8_4_4_lookup(phase, capacity):
with capacities >= 15KVA and
<= 333kVA for single-phase or
<= 1000kVA for three-phase.
For capacities bewteen the listed values, linear interpolation is used.
For capacities between the listed values, linear interpolation is used.
Parameters
----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def is_hvac_sys_preheat_fluid_loop_attached_to_boiler(rmd_b, hvac_b_id):
# Get the hvac system
hvac_b = find_exactly_one_hvac_system(rmd_b, hvac_b_id)
# hot_water_loop_id can be None
hot_water_loop_id = find_one("preheat_system.hot_water_loop", hvac_b)
hot_water_loop_id = find_one("$.preheat_system.hot_water_loop", hvac_b)
if hot_water_loop_id in loop_boiler_id_list:
hot_water_loop = find_exactly_one_fluid_loop(rmd_b, hot_water_loop_id)
is_hvac_sys_preheat_fluid_loop_attached_to_boiler_flag = (
find_one("type", hot_water_loop) == FLUID_LOOP.HEATING
find_one("$.type", hot_water_loop) == FLUID_LOOP.HEATING
)

return is_hvac_sys_preheat_fluid_loop_attached_to_boiler_flag
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def is_hvac_sys_preheating_type_fluid_loop(rmd_b: dict, hvac_b_id: str) -> bool:
preheat_system is not None
and preheat_system.get("hot_water_loop") is not None
# Silence fail if heating system type data is not in RMD
and find_one("type", preheat_system) == HEATING_SYSTEM.FLUID_LOOP
and find_one("$.type", preheat_system) == HEATING_SYSTEM.FLUID_LOOP
)

return is_hvac_sys_preheating_type_fluid_loop_flag
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def compare_schedules(
if hourly value is 1, schedule_1 is evaluated to be equal to schedule_2;
if hourly value is 2, schedule_1 is evaluated to be equal to schedule_2 times the comparison factor;
if hourly value is 0, comparison was skipped for that particular hour
(example when evaluating shut off controls, only he building closed hrs are evaluated) exmaple: [1,1,1,1,1...]
(example when evaluating shut off controls, only he building closed hrs are evaluated) example: [1,1,1,1,1...]
is_leap_year: bool, indicate whether the comparison is in a leap year or not. True / False
Returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def get_area_type_window_wall_area_dict(
)

# add sub-surfaces
for subsurface in find_all("subsurfaces[*]", surface):
for subsurface in find_all("$.subsurfaces[*]", surface):
glazed_area = getattr_(subsurface, "subsurface", "glazed_area")
opaque_area = getattr_(subsurface, "subsurface", "opaque_area")
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_avg_zone_height(zone: dict) -> Quantity:
find_exactly_required_fields(GET_AVG_ZONE_HEIGHT__REQUIRED_FIELDS["zone"], zone)

zone_volume = zone["volume"]
zone_floor_area = sum(find_all("spaces[*].floor_area", zone))
zone_floor_area = sum(find_all("$.spaces[*].floor_area", zone))

assert_(
zone_floor_area > ZERO.AREA, f"zone:{zone['id']} has zero total floor area."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def get_building_scc_skylight_roof_ratios_dict(

def _helper_calculate_skylight_area(surface: dict) -> Quantity:
total_glazed_area = ZERO.AREA
for subsurface in find_all("subsurfaces[*]", surface):
for subsurface in find_all("$.subsurfaces[*]", surface):
glazed_area = getattr_(subsurface, "subsurface", "glazed_area")
opaque_area = getattr_(subsurface, "subsurface", "opaque_area")
if getattr_(subsurface, "subsurface", "classification") == DOOR:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_building_scc_window_wall_ratios_dict(
if get_opaque_surface_type(surface) == OST.ABOVE_GRADE_WALL:
surface_area = surface["area"]
surface_window_area = ZERO.AREA
for subsurface in find_all("subsurfaces[*]", surface):
for subsurface in find_all("$.subsurfaces[*]", surface):
glazed_area = subsurface.get("glazed_area", ZERO.AREA)
opaque_area = subsurface.get("opaque_area", ZERO.AREA)
surface_window_area += (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,22 @@ def get_building_segment_skylight_roof_areas_dict(
scc_dict = get_surface_conditioning_category_dict(climate_zone, building)
building_segment_roof_areas_dict = {}

for building_segment in find_all("building_segments[*]", building):
for building_segment in find_all("$.building_segments[*]", building):
building_segment_roof_areas_dict[
building_segment["id"]
] = building_segment_roof_areas = {
"total_envelope_roof_area": ZERO.AREA,
"total_skylight_area": ZERO.AREA,
}

for zone in find_all("zones[*]", building_segment):
for zone in find_all("$.zones[*]", building_segment):
if zcc_dict[zone["id"]] in [
ZCC.CONDITIONED_RESIDENTIAL,
ZCC.CONDITIONED_NON_RESIDENTIAL,
ZCC.CONDITIONED_MIXED,
ZCC.SEMI_HEATED,
]:
for surface in find_all("surfaces[*]", zone):
for surface in find_all("$.surfaces[*]", zone):
if get_opaque_surface_type(surface) == OST.ROOF and scc_dict[
surface["id"]
] in [
Expand All @@ -89,9 +89,9 @@ def get_building_segment_skylight_roof_areas_dict(
] += getattr_(surface, "surface", "area")

building_segment_roof_areas["total_skylight_area"] += sum(
find_all("subsurfaces[*].glazed_area", surface), ZERO.AREA
find_all("$.subsurfaces[*].glazed_area", surface), ZERO.AREA
) + sum(
find_all("subsurfaces[*].opaque_area", surface), ZERO.AREA
find_all("$.subsurfaces[*].opaque_area", surface), ZERO.AREA
)

return building_segment_roof_areas_dict
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_opaque_surface_type(surface: dict) -> str:
A dictionary representing a surface as defined by the ASHRAE229 schema.
It is assumed to have at least the minimal structure:
{
ajacent_to,
adjacent_to,
construction: {
has_radiant_heating
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def get_zone_conditioning_category_dict(
find_all("surfaces[*]", zone), f"zone:{zone_id} has no surfaces"
)
for surface in zone["surfaces"]:
subsurfaces = find_all("subsurfaces[*]", surface)
subsurfaces = find_all("$.subsurfaces[*]", surface)
# Calculate the total area of all subsurfaces
subsurfaces_area = sum(
[
Expand All @@ -266,7 +266,7 @@ def get_zone_conditioning_category_dict(
],
ZERO.UA, # value used if there are no subsurfaces
)
# Calculate the are of the surface that is not part of a subsurface
# Calculate the area of the surface that is not part of a subsurface
non_subsurfaces_area = (
getattr_(surface, "surface", "area") - subsurfaces_area
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def normalize_interior_lighting_schedules(
adjust_for_credit: Boolean - indicate whether the function needs to adjust schedule value by control credit
Returns
-------
A list containing 8760/8784 hourly values of a noralized schedule of the space data element
A list containing 8760/8784 hourly values of a normalized schedule of the space data element
"""

# Implementation note:
Expand Down
4 changes: 2 additions & 2 deletions rct229/rulesets/ashrae9012019/section10/section10rule7.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def is_applicable(self, context, data=None):
rmd_b = context.BASELINE_0
baseline_system_types_dict = get_baseline_system_types(rmd_b)
baseline_sys_5_6_serve_more_than_one_flr_list = (
get_hvac_systems_5_6_serving_multiple_floors(rmd_b).keys()
get_hvac_systems_5_6_serving_multiple_floors(rmd_b)
)
# create a list containing all HVAC systems that are modeled in the rmd_b
available_types_list_excl_5_6_multifloor = [
Expand All @@ -89,7 +89,7 @@ def create_data(self, context, data):
rmd_b = context.BASELINE_0
baseline_system_types_dict = get_baseline_system_types(rmd_b)
baseline_sys_5_6_serve_more_than_one_flr_list = (
get_hvac_systems_5_6_serving_multiple_floors(rmd_b).keys()
get_hvac_systems_5_6_serving_multiple_floors(rmd_b)
)
baseline_system_zones_served_dict = {
hvac_id: [
Expand Down
4 changes: 2 additions & 2 deletions rct229/rulesets/ashrae9012019/section18/section18rule2.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,13 @@ def get_manual_check_required_msg(self, context, calc_vals=None, data=None):
if does_sys_only_serve_lab_b:
undetermined_msg = (
"This system serves only lab zones, which is correct if the building has total lab exhaust greater than 15,000 cfm. "
"However, we could not determine with accuracy the total building exhuast."
"However, we could not determine with accuracy the total building exhaust."
)
elif does_sys_serve_lab_and_other_b:
undetermined_msg = "This system serves some lab zones and some non-lab zones in a building which may have more than 15,000 cfm. In buildings with > 15,000 cfm of lab exhaust, ALL and only lab zones should be served by system type 5 or 7."
elif does_two_sys_exist_on_same_fl_b == "undetermined":
undetermined_msg = (
f"This HVAC system is on the same floor as {hvac_sys2_id_b}, which servese lab zones in the building. "
f"This HVAC system is on the same floor as {hvac_sys2_id_b}, which serves lab zones in the building. "
f"If the building has greater than 15,000 cfm of lab exhaust and {hvac_sys2_id_b} is System type 5 or 7 serving only lab zones, this system passes, otherwise it fails."
)

Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section19/section19rule17.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def is_applicable(self, context, data=None):

return any(
hvac_id_b in baseline_system_types_dict[system_type]
for system_type in baseline_system_types_dict.keys()
for system_type in baseline_system_types_dict
)

def get_calc_vals(self, context, data=None):
Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section19/section19rule28.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self):
each_rule=Section19Rule28.HVACRule(),
index_rmd=PROPOSED,
id="19-28",
description="chedules for HVAC fans that provide outdoor air for ventilation in the proposed design shall be cycled ON and OFF to meet heating and cooling loads during unoccupied hours excluding HVAC systems that meet Table G3.1-4 Schedules for the proposed building exceptions #2 and #3."
description="Schedules for HVAC fans that provide outdoor air for ventilation in the proposed design shall be cycled ON and OFF to meet heating and cooling loads during unoccupied hours excluding HVAC systems that meet Table G3.1-4 Schedules for the proposed building exceptions #2 and #3."
"#2 HVAC fans shall remain on during occupied and unoccupied hours in spaces that have health- and safety mandated minimum ventilation requirements during unoccupied hours."
"#3 HVAC fans shall remain on during occupied and unoccupied hours in systems primarily serving computer rooms.",
ruleset_section_title="HVAC - General",
Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section19/section19rule4.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def get_calc_vals(self, context, data=None):
if not misc_pass_cooling_b:
multiplier_sch_light_b = getattr_(
misc_equip_b,
"Mmiscellaneous Equipment",
"miscellaneous_equipment",
"multiplier_schedule",
)

Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section19/section19rule7.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self):
description="Minimum ventilation system outdoor air intake flow shall be the same for the proposed design and baseline building design except when any of the 4 exceptions defined in Section G3.1.2.5 are met."
"Exceptions included in this RDS: 2. When designing systems in accordance with Standard 62.1, Section 6.2, `Ventilation Rate Procedure,`"
"reduced ventilation airflow rates may be calculated for each HVAC zone in the proposed design with a zone air distribution effectiveness (Ez) > 1.0 as defined by Standard 62.1, Table 6-2. "
"Baseline ventilation airflow rates in those zones shall be calcu-lated using the proposed design Ventilation Rate Procedure calculation with the following change only. Zone air distribution effectiveness shall be changed to (Ez) = 1.0 in each zone having a zone air distribution effectiveness (Ez) > 1.0. "
"Baseline ventilation airflow rates in those zones shall be calculated using the proposed design Ventilation Rate Procedure calculation with the following change only. Zone air distribution effectiveness shall be changed to (Ez) = 1.0 in each zone having a zone air distribution effectiveness (Ez) > 1.0. "
"Proposed design and baseline build-ing design Ventilation Rate Procedure calculations, as described in Standard 62.1, shall be submitted to the rating authority to claim credit for this exception.",
ruleset_section_title="HVAC - General",
standard_section="Section G3.1.2.5 and Exception 2",
Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section21/section21rule18.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self):
required_fields={
"$": ["energy_source_type"],
},
manual_check_required_msg="Basline boiler fuel source is modeled as propane. Verify if natural gas is not available for the proposed building site as determined by the rating authority.",
manual_check_required_msg="Baseline boiler fuel source is modeled as propane. Verify if natural gas is not available for the proposed building site as determined by the rating authority.",
)

def get_calc_vals(self, context, data=None):
Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section21/section21rule5.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def get_calc_vals(self, context, data=None):
ZERO.AREA,
)

num_boilers = len(find_all(".boilers[*]", rmd_b))
num_boilers = len(find_all("$.boilers[*]", rmd_b))
boiler_capacity_list = [
CalcQ("capacity", getattr_(boiler, "boiler", "rated_capacity"))
for boiler in find_all("$.boilers[*]", rmd_b)
Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section21/section21rule8.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self):
each_rule=Section21Rule8.HeatingFluidLoopRule(),
index_rmd=BASELINE_0,
id="21-8",
description="When the baseline building requires boilers, (for baseline system type = 1,5,7,11 and 12), HWST for the baseline building shall be reset using an outdoor air dry-bulb reset schedule. 180F at 20F OAT, 150Fat 50F OAT, ramped linerarly between 150F and 180F.",
description="When the baseline building requires boilers, (for baseline system type = 1,5,7,11 and 12), HWST for the baseline building shall be reset using an outdoor air dry-bulb reset schedule. 180F at 20F OAT, 150Fat 50F OAT, ramped linearly between 150F and 180F.",
ruleset_section_title="HVAC - Water Side",
standard_section="Section G3.1.3.3 Building System-Specific Modeling Requirements for the Baseline model",
is_primary_rule=True,
Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section22/section22rule19.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def create_data(self, context, data):
heat_rejection_loop_id: find_exactly_one_with_field_value(
"$.fluid_loops[*]", "id", heat_rejection_loop_id, rmd_b
)
for heat_rejection_loop_id in find_all("heat_rejections[*].loop", rmd_b)
for heat_rejection_loop_id in find_all("$.heat_rejections[*].loop", rmd_b)
}
return {"heat_rejection_loop_dict": heat_rejection_loop_dict}

Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section22/section22rule20.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def is_applicable(self, context, data=None):
# create a list containing all HVAC systems that are modeled in the rmd_b
available_type_list = [
hvac_type
for hvac_type in baseline_system_types_dict.keys()
for hvac_type in baseline_system_types_dict
if len(baseline_system_types_dict[hvac_type]) > 0
]
return any(
Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section22/section22rule29.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def create_data(self, context, data):
chiller["condensing_loop"]: find_exactly_one_fluid_loop(
rmd_b, getattr_(chiller, "Chiller", "condensing_loop")
).get("pump_power_per_flow_rate")
for chiller in find_all("chillers[*]", rmd_b)
for chiller in find_all("$.chillers[*]", rmd_b)
}
return {"condenser_loop_pump_power_dict": condenser_loop_pump_power_dict}

Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section22/section22rule3.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def is_applicable(self, context, data=None):

def create_data(self, context, data):
rmd_b = context.BASELINE_0
chiller_loop_ids_list = find_all("chillers[*].cooling_loop", rmd_b)
chiller_loop_ids_list = find_all("$.chillers[*].cooling_loop", rmd_b)
return {"chiller_loop_ids": chiller_loop_ids_list}

def list_filter(self, context_item, data):
Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section22/section22rule30.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def create_data(self, context, data):
chiller["condensing_loop"]: find_exactly_one_fluid_loop(
rmd_b, chiller["condensing_loop"]
).get("pump_power_per_flow_rate")
for chiller in find_all("chillers[*]", rmd_b)
for chiller in find_all("$.chillers[*]", rmd_b)
}
return {"condenser_loop_pump_power_dict": condenser_loop_pump_power_dict}

Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section22/section22rule39.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self):
is_primary_rule=False,
list_path="ruleset_model_descriptions[0]",
manual_check_required_msg="Manual Check Required - Baseline is modeled with purchased chilled water. Make sure "
"baseline systems served by purchased chilled water are modeled with a distribution pump whose pump ower is 16W/gpm.",
"baseline systems served by purchased chilled water are modeled with a distribution pump whose pump power is 16W/gpm.",
not_applicable_msg="Rule 22-39 Not Applicable - the baseline is not modeled with Purchased Chilled Water",
)

Expand Down
2 changes: 1 addition & 1 deletion rct229/rulesets/ashrae9012019/section22/section22rule4.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def is_applicable(self, context, data=None):

def create_data(self, context, data):
rmd_b = context.BASELINE_0
chiller_loop_ids_list = find_all("chillers[*].cooling_loop", rmd_b)
chiller_loop_ids_list = find_all("$.chillers[*].cooling_loop", rmd_b)
return {"chiller_loop_ids_list": chiller_loop_ids_list}

def list_filter(self, context_item, data):
Expand Down
Loading

0 comments on commit 3878d5b

Please sign in to comment.