Repository navigation
Fix/floor area building first - #22
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
🟡 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"] |
Contributor
There was a problem hiding this comment.
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

get_total_floor_areacheckedSite/FloorAreasbeforeBuilding/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.rbfailed 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
get_total_floor_areablock).BOSS/boss_loggerandBOSS/constantsdirectly inbuildingsync_reader.rb.