[codex] add per-floor building assignments#69
Draft
szvsw wants to merge 2 commits into
Draft
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
=======================================
+ Coverage 64.1% 69.2% +5.1%
=======================================
Files 34 37 +3
Lines 5001 5750 +749
Branches 452 567 +115
=======================================
+ Hits 3207 3984 +777
+ Misses 1641 1572 -69
- Partials 153 194 +41 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Resolve the blocking and major issues from the review of the floor-first SBEM assignment API: - fix FlatModel.zone_template() so the legacy -> BuildingFlatModel adapter no longer trips ZoneTemplate's extra="forbid" (project onto template fields) - reject per-floor RoofRValue/SlabRValue overrides (removed from PartialZoneTemplate) since they are building-wide, not per-floor yet - reject WWR overrides on core zones, which have no exterior walls - rename zone-energy columns to make accounting explicit (sim_lighting_site_kwh, sim_equipment_site_kwh, sim_total_included_kwh) and document that DHW is excluded and HVAC is delivered thermal energy - drop duplicate metadata in merge_assignment_and_energy so the join no longer produces _x/_y suffixed columns - validate floor_results has exactly one row per above-grade floor - warn when heterogeneous fuels make the building-level energy_and_peak utility mapping approximate - make total_people/compute_dhw resolver-aware (per-zone, IDF-based) instead of using building-wide defaults under zone assignments - drive ground temperature from ground-contact zones only (basement, or the lowest above-grade floor) instead of all floors - default from_uniform_flat_model zoning to the source model's zoning - report as-built actual_wwr / glazed / exterior-wall areas in the assignment and floor summaries, using wall-area-weighted floor WWR - extract zone_template_to_zone_component into a pure function over ZoneTemplate instead of fabricating a dummy FlatModel Add tests covering FlatModel compatibility, boundary/WWR override rejection, attic/basement parsing and scaling, object-name uniqueness, merge stability, floor row counts, and ground-contact ground temperature. Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
Adds a typed, floor-first SBEM API for heterogeneous shoebox buildings:
BuildingFlatModel,BuildingShell,ZoneTemplate,PartialZoneTemplate,FloorBand, andZoneAssignmentResolverModel(Zone=...)andFlatModelpath, withFlatModel.to_building_model()as a compatibility adapterzone_results/floor_resultsto assignment-backed runsValidation
Passed:
uv run pytest tests/test_sbem/test_zone_assignment.py tests/test_sbem/test_floor_assignment_build.py tests/test_analysis/test_zone_energy.py -q-> 11 passedBuildingFlatModel; returned exactly 2 floor rows and the high-LPD floor had higher simulated lighting kWh/m2uv run pyright epinterface\sbem\zone_assignment.py epinterface\sbem\building_flat_model.py epinterface\analysis\zone_energy.py epinterface\sbem\flat_model.py epinterface\sbem\builder.py-> 0 errorsFull-suite note:
uv run pytest -qreached 255 passed / 8 skipped / 2 xfailed, but failed on Prisma-backed tests during fixture/database setup. The common error wasRuntimeError: Error applying migrationsfromprisma migrate deploy, with Prisma reportingSchema engine errorbefore the affected test bodies ran.Design Notes
The implementation intentionally keeps roof/slab/interior boundary constructions shared from defaults. Floor/role-specific facade and glazing construction assignment is applied zone-by-zone, while WWR is handled geometrically per floor/zone via EnergyPlus fenestration reset. This keeps unsupported envelope semantics from being silently implied while satisfying the per-floor WWR requirement.