fix(wbdg_office, samuel_macalister): doubled MEP counts (Q988/989/997/1004/1016) and load-bearing split (Q686)

#13

Corrects the reference answers of six questions on two models. Every value was checked against the IFC with ifcopenshell 0.8; the script and its output are below.

wbdg_office/mep: Q988, Q989, Q997, Q1004, Q1016 (all counts doubled)

Every segment, fitting, terminal and fan count in these answers is exactly 2× what the IFC contains. Counts are grouped by PSet_Revit_Mechanical.System Type, since the file has no IfcSystem. All 1959 IfcFlowSegments have unique GlobalIds, so there are no duplicates in the file. The single-instance items in Q988 (10 controllers, 1 pump, 1 energy conversion device) already match and are unchanged. The mep.ifc LFS object is the same since v2.0.0.

Q Item Old New
988 plumbing segment / fitting / terminal 1182 / 1158 / 80 591 / 579 / 40
989 Sanitary / DCW / DHW pipe segments (total) 540 / 414 / 228 (1182) 270 / 207 / 114 (591)
997 ventilation fitting / segment / terminal / fan 1642 / 1284 / 490 / 48 821 / 642 / 245 / 24
1004 supply / return / exhaust duct segments (total) 766 / 514 / 4 (1284) 383 / 257 / 2 (642)
1016 fire total; fitting / segment / terminal; 15 mm Pendent 3600; 1626 / 1390 / 584; 584 1800; 813 / 695 / 292; 292
1016 per level, Level 1 / Level 2 724 / 666 362 / 333

For Q1016 the old per-level numbers summed to the segment count (724 + 666 = 1390), so I relabelled that block "Pipe Segments by Level" instead of "Component Breakdown by Level". Fittings and sprinklers are mostly contained in spaces, not storeys.

samuel_macalister_sample_house/arc: Q686 (load-bearing split)

Pset_WallCommon.LoadBearing is set on all 48 walls: 11 true, 37 false, none unset. The old answer gave 0 non-load-bearing and 37 unspecified walls, with percentages (11.8 / 48.6 / 39.5) that match none of the counts. New: load-bearing 11 (22.9%), non-load-bearing 37 (77.1%), unspecified 0 (0.0%). The three load-bearing wall types were already correct (CL_W1 ×5, Retaining 300mm ×5, Foundation 300mm ×1).

Checks

  • CSV still parses to 1,026 rows; ids, questions, projects, models, categories and the split are unchanged.
  • Only the ground_truth cells of 686, 988, 989, 997, 1004 and 1016 changed; the rest of the file is byte-identical.
  • README v2 checksum updated to 1a3409a0….
Script and output
"""Evidence for the upstream PR: Q686 (samuel_macalister_sample_house) and Q988/989/997/1004/1016 (wbdg_office/mep).
Usage: python pr_evidence.py <ifc-bench root>"""
import sys
from collections import Counter
import ifcopenshell
from ifcopenshell.util.element import get_psets, get_container, get_type

root = sys.argv[1]

f = ifcopenshell.open(f"{root}/projects/samuel_macalister_sample_house/arc.ifc")
walls = f.by_type("IfcWall")  # includes IfcWallStandardCase
lb = Counter(get_psets(w).get("Pset_WallCommon", {}).get("LoadBearing") for w in walls)
print(f"Q686  walls={len(walls)}  LoadBearing: {dict(lb)}")
print("      load-bearing types:", dict(Counter(w.ObjectType for w in walls
      if get_psets(w).get("Pset_WallCommon", {}).get("LoadBearing") is True)))

f = ifcopenshell.open(f"{root}/projects/wbdg_office/mep.ifc")
print("\nwbdg_office/mep  IfcSystem:", len(f.by_type("IfcSystem")),
      " IfcFlowSegment:", len(f.by_type("IfcFlowSegment")),
      " unique GlobalIds:", len({s.GlobalId for s in f.by_type("IfcFlowSegment")}))
def st(e):  # Revit 'System Type' (comma-joined for multi-system elements)
    return next((ps["System Type"] for ps in get_psets(e).values() if "System Type" in ps), None)
def short(e): return e.is_a()[len("IfcFlow"):] if e.is_a().startswith("IfcFlow") else e.is_a()[3:]
els = f.by_type("IfcDistributionFlowElement")
def count(systems, cls=None):
    return Counter(short(e) for e in els if st(e) and set(st(e).split(",")) & systems
                   and (cls is None or e.is_a(cls)))
PLUMB = {"Domestic Cold Water", "Domestic Hot Water", "Sanitary"}
VENT = {"Supply Air", "Return Air", "Exhaust Air"}
print("\nQ988  plumbing components by class:", dict(count(PLUMB)))
print("Q989  pipe segments by system:", {s: count({s}, "IfcFlowSegment")["Segment"] for s in sorted(PLUMB)})
print("\nQ997  ventilation components by class:", dict(count(VENT)))
print("Q1004 duct segments by system:", {s: count({s}, "IfcFlowSegment")["Segment"] for s in sorted(VENT)})
fire = [e for e in els if st(e) == "Fire Protection Wet"]
print("\nQ1016 Fire Protection Wet:", len(fire), dict(Counter(short(e) for e in fire)))
print("      sprinkler types:", dict(Counter(get_type(e).Name for e in fire if e.is_a("IfcFlowTerminal"))))
print("      segments by storey:", dict(Counter(get_container(e).Name for e in fire if e.is_a("IfcFlowSegment"))))
Q686  walls=48  LoadBearing: {False: 37, True: 11}
      load-bearing types: {'Basic Wall:CL_W1:600634': 5, 'Basic Wall:Foundation - 300mm Concrete:581500': 1, 'Basic Wall:Retaining - 300mm Concrete:711906': 5}

wbdg_office/mep  IfcSystem: 0  IfcFlowSegment: 1959  unique GlobalIds: 1959

Q988  plumbing components by class: {'EnergyConversionDevice': 1, 'Controller': 10, 'Fitting': 579, 'MovingDevice': 1, 'Segment': 591, 'StorageDevice': 1, 'Terminal': 40}
Q989  pipe segments by system: {'Domestic Cold Water': 207, 'Domestic Hot Water': 114, 'Sanitary': 270}

Q997  ventilation components by class: {'Fitting': 821, 'MovingDevice': 24, 'Segment': 642, 'StorageDevice': 1, 'Terminal': 245}
Q1004 duct segments by system: {'Exhaust Air': 2, 'Return Air': 257, 'Supply Air': 383}

Q1016 Fire Protection Wet: 1800 {'Fitting': 813, 'Segment': 695, 'Terminal': 292}
      sprinkler types: {'15 mm Pendent': 292}
      segments by storey: {'Level 2': 333, 'Level 1': 362}

🤖 Generated with Claude Code

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment