Skip to content

Addition of cost analysis capability to SCOPE measures#91

Draft
prsh5175 wants to merge 537 commits intodevelopfrom
replace-windows-EC
Draft

Addition of cost analysis capability to SCOPE measures#91
prsh5175 wants to merge 537 commits intodevelopfrom
replace-windows-EC

Conversation

@prsh5175
Copy link
Copy Markdown
Collaborator

@prsh5175 prsh5175 commented Feb 27, 2026

Addition of RSMeans API lookup and cost analysis visualization capabilities to SCOPE measures.

  • Note: Name of the branch may be misleading but the 'replace-windows-EC' branch is now not just associated with features related to window enhancement measures, but it is the main feature branch for SCOPE measures that integrates measures such as window, door, wall insulation, roof insulation and parametric analysis features. New functionality related to RSMeans API calls (to all measures: doors, roof, wall) will be integrated with the 'replace-windows-EC' branch, which will ultimately be merged to develop branch when ready.

To-Do:

prsh5175 and others added 30 commits April 16, 2026 15:03
… score threshold, cost basis fields, comments, docs, and setup automation
…sure

- Remove hardcoded API key from config.ini (replace with placeholder)
- Add config.ini to .gitignore (already present)
- Create config.ini.template with setup instructions
- Add environment variable fallback (EC3_API_TOKEN env var) in apply_measure.py
  - Priority: env var > config.ini > error with guidance
  - Detects placeholder values and rejects them
- Update measure.py API token argument with security warnings
  - Advise users to use env vars for CI/CD instead of raw tokens
- Create SECURITY.md documenting API key management best practices
  - Local dev vs CI/CD workflows
  - GitHub Actions secret configuration
  - Credential rotation procedures
  - Code review checklist

This ensures API keys are never accidentally committed and provides
clear guidance for secure usage across local, CI/CD, and production
environments.
- Update ENVIRONMENT_SETUP.md with latest setup instructions
- Update RSMEANS_SEARCH_STRATEGY.md with current search approach
- Update Window_Enhancement.md with measure details and features
- Add setup_environment.ps1 PowerShell setup helper script
- Update call_rsmeans_api.py with improved RSMeans helper logic
  - Set MIN_ACCEPTABLE_MATCH_SCORE threshold to 50.0
  - Improve fallback comment clarity
…ulation_rsmeans_selection_mode, total installed cost; align with wall measure
…t still use unit not area, sealing cost is not using openstudio's model's width and length
Co-authored-by: Copilot <copilot@github.com>
…ave been implemented

Co-authored-by: Copilot <copilot@github.com>
…nal properties

Co-authored-by: Copilot <copilot@github.com>
…filled in additional properties

Co-authored-by: Copilot <copilot@github.com>
…t fulfilled in additional properties

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Window enhancement:
- RSMeans glazing items are priced per EA (per window unit), not per SF.
  Changed glazing material payload to use num_windows as quantity with
  costing_mode="area" instead of glazing area in SF with volume_from_area.
  This eliminates ~30x cost inflation ($1.1M → ~$36K for SmallOffice).
- Added num_windows parameter to _build_rsmeans_material_payload; passed
  total_window_constructions from the call site.
- Preserved glazing_area_sf on the material dict for fallback ID bin
  selection in _get_default_fallback_rsmeans_id and
  _derive_frame_cost_from_window_minus_glass.
- Frame total cost now multiplies by num_windows (EA) not glazing area SF.

Door enhancement:
- Fixed sys.path pollution: wall/roof measures inject their resource
  directories into sys.path, causing Python to load the wrong
  call_rsmeans_api.py for door seal lookups. Now uses importlib to
  force load the correct module by file path.
- Added graceful fallback in _lookup_cost_item_by_rsmeans_id: when an
  exact 12-char RSMeans ID is not found, falls back to the first item in
  the section with a positive cost instead of silently returning None.
- Door area mismatch now issues a registerWarning instead of a hard stop.

Roof insulation:
- RSMeans tie ambiguity (equal-scored candidates) now issues a
  registerWarning and picks the first candidate instead of calling
  registerError and halting the measure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO NOT MERGE enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants