Skip to content

Fix/floor area building first - #22

Merged
kflemin merged 4 commits into
developfrom
fix/floor-area-building-first
Nov 12, 2026
Merged

kflemin merged 4 commits into
developfrom
fix/floor-area-building-first

Conversation

@kflemin

@kflemin kflemin commented Nov 10, 2026

Copy link
Copy Markdown
Contributor
  • get_total_floor_area checked Site/FloorAreas before Building/FloorAreas, so a Site value overrode the Building's own floor area. The method comment already said Building should come first. BuildingSync tools should use the most specific value when both are present.
  • buildingsync_reader_spec.rb failed when run on its own (undefined method 'BOSS_logger' for BOSS:Module). The reader relied on other files to load the logger and constants.

What this does

  • Checks Building floor area first and falls back to Site.
  • Adds specs for Building only, Site only, and both present (the previously empty get_total_floor_area block).
  • Updates the README input table to say Building wins when both are present.
  • Requires BOSS/boss_logger and BOSS/constants directly in buildingsync_reader.rb.

kflemin and others added 2 commits November 10, 2026 12:53
get_total_floor_area checked Site FloorAreas before Building, so a
Site value overrode the Building's own value. Check the more specific
Building first and fall back to Site, matching the method comment.

Add specs for Building only, Site only, and both present.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reader calls BOSS.BOSS_logger and uses ASHRAE90_1 and other
constants, but relied on other files to load them. Running
buildingsync_reader_spec.rb on its own failed with "undefined method
`BOSS_logger' for BOSS:Module". Require both directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The unguarded Building lookup raises NoMethodError for Site-only documents before reaching the area fallback, and the new spec’s empty Building element leaves this regression untested.

1 open issue
What changed in this PR

This PR makes BuildingSync floor-area selection prefer the Building’s value over the Site’s value and adds direct dependencies for standalone reader use.

Changes:

  • Checks Building floor area first, falling back to Site.
  • Adds specs for Building-only values, Site fallback, and precedence when both have values.
  • Documents the precedence and explicitly requires the logger and constants.
File Description
spec/​tests/​unit/​buildingsync_reader_spec.rb Adds three floor-area selection specs.
README.md Documents Building-over-Site precedence.
lib/​BOSS/​buildingsync_reader/​buildingsync_reader.rb Reorders floor-area lookup and adds direct dependency requires.

Review effort: Balanced


# check site floor area
BOSS.BOSS_logger.info("#{"|\t"*num_indent}- checking site for total floor area...")
site_floor_areas_xml = @site_xml.elements["#{@ns}FloorAreas"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bcf2317 by guarding the Building floor-area lookup and adding a Site-only regression spec.

Co-authored-by: kflemin <2205659+kflemin@users.noreply.github.com>
@kflemin
kflemin merged commit 1929a26 into develop Nov 12, 2026
1 check passed
JieXiong9119 added a commit that referenced this pull request Nov 18, 2026
commit b45ec37
Merge: 0496378 e0bb39b
Author: JieXiong9119 <69597597+JieXiong9119@users.noreply.github.com>
Date:   Tue Nov 17 17:39:18 2026 -0700

    Merge branch 'develop' into scenario-workflow

commit e0bb39b
Merge: 1929a26 65bb0a9
Author: Jie Xiong <jiexiong9119@gmail.com>
Date:   Tue Nov 17 17:30:42 2026 -0700

    Merge pull request #32 from BuildingSync/speed-up-ci

    Speed up CI

commit 65bb0a9
Author: JieXiong9119 <69597597+JieXiong9119@users.noreply.github.com>
Date:   Tue Nov 17 14:01:59 2026 -0700

    split jobs into unit and integration, split integration into 4 shards

    doc-only PRs skip integration
    skip-integration label skips integration

commit 1929a26
Merge: 871317d 711e45f
Author: Katherine Fleming <2205659+kflemin@users.noreply.github.com>
Date:   Thu Nov 12 10:43:31 2026 -0700

    Merge pull request #22 from BuildingSync/fix/floor-area-building-first

    Fix/floor area building first

commit 711e45f
Author: Katherine Fleming <2205659+kflemin@users.noreply.github.com>
Date:   Wed Nov 11 12:29:18 2026 -0700

    fix test

commit bcf2317
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date:   Tue Nov 10 22:21:50 2026 +0000

    Handle missing Building in floor area fallback

    Co-authored-by: kflemin <2205659+kflemin@users.noreply.github.com>

commit 35abcbf
Author: Katherine Fleming <2205659+kflemin@users.noreply.github.com>
Date:   Tue Nov 10 12:57:19 2026 -0700

    Require logger and constants in BuildingSyncReader

    The reader calls BOSS.BOSS_logger and uses ASHRAE90_1 and other
    constants, but relied on other files to load them. Running
    buildingsync_reader_spec.rb on its own failed with "undefined method
    `BOSS_logger' for BOSS:Module". Require both directly.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

commit 43fc2da
Author: Katherine Fleming <2205659+kflemin@users.noreply.github.com>
Date:   Tue Nov 10 12:53:24 2026 -0700

    Prefer Building floor area over Site

    get_total_floor_area checked Site FloorAreas before Building, so a
    Site value overrode the Building's own value. Check the more specific
    Building first and fall back to Site, matching the method comment.

    Add specs for Building only, Site only, and both present.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants