Skip to content

Commit

Permalink
update reference to get_swh_uses_associated_with_each_building_segment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiarongx-Xie committed Nov 19, 2024
1 parent 0f4548e commit dc8637c
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions rct229/rulesets/ashrae9012019/section11/section11rule11.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
get_swh_uses_associated_with_each_building_segment,
)
from rct229.utils.jsonpath_utils import find_all
from rct229.utils.utility_functions import find_exactly_one_swh_use


class Section11Rule11(RuleDefinitionListIndexedBase):
Expand Down Expand Up @@ -45,13 +44,13 @@ def is_applicable(self, context, data=None):
rmd_p = context.PROPOSED
swh_use_loads_p = sum(
[
find_exactly_one_swh_use(rmd_p, swh_use_id).get("use", 0.0)
for building_segment in find_all(
swh_use_p.get("use", 0.0)
for building_segment_p in find_all(
"$.buildings[*].building_segments[*]", rmd_p
)
for swh_use_id in get_swh_uses_associated_with_each_building_segment(
rmd_p, building_segment["id"]
)
for swh_use_p in get_swh_uses_associated_with_each_building_segment(
rmd_p
)[building_segment_p["id"]]
]
)

Expand All @@ -63,12 +62,9 @@ def create_data(self, context, data):
for building_segment_b in find_all(
"$.buildings[*].building_segments[*]", rmd_b
):
swh_use_list_b = [
find_exactly_one_swh_use(rmd_b, swh_use_id)
for swh_use_id in get_swh_uses_associated_with_each_building_segment(
rmd_b, building_segment_b["id"]
)
]
swh_use_list_b = get_swh_uses_associated_with_each_building_segment(
rmd_b
)[building_segment_b["id"]]
building_segment_associated_swh_use_dict_b.setdefault(
building_segment_b["id"], []
).extend(swh_use_list_b)
Expand Down

0 comments on commit dc8637c

Please sign in to comment.