Skip to content

Ccaradon/measure doc assets - #464

Open
ChristopherCaradonna wants to merge 5 commits into
mainfrom
ccaradon/measure-doc-assets
Open

ChristopherCaradonna wants to merge 5 commits into
mainfrom
ccaradon/measure-doc-assets

Conversation

@ChristopherCaradonna

@ChristopherCaradonna ChristopherCaradonna commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Pull request overview

Adds assets used to create measure documentation.

Pull Request Author

This pull request makes changes to (select all the apply):

  • Documentation
  • Infrastructure (includes apptainer image, buildstock batch, dependencies, continuous integration tests)
  • Sampling
  • Workflow Measures
  • Upgrade Measures
  • Reporting Measures
  • Postprocessing

Pull Request Author Checklist:

  • Tagged the pull request with the appropriate label (documentation, infrastructure, sampling, workflow measure, upgrade measure, reporting measure, postprocessing) to help categorize changes in the release notes.
  • Added 'See ComStock License' language to first two lines of each code file
  • All new / modified functions have docstrings

Pull Request Reviewer Checklist:

  • Perform a code review on GitHub
  • Author had ensured all modified and new functions have docstrings
  • All changes have been implemented: data, methods, tests, documentation
  • New measure tests add to to test/reporting_measure_tests.txt, test/workflow_measure_tests.txt, or test/upgrade_measure_tests.txt
  • Ensured code files contain License reference

ComStock Licensing Language - Add to Beginning of Each Code File

# ComStock™, Copyright (c) 2025 Alliance for Sustainable Energy, LLC. All rights reserved.
# See top level LICENSE.txt file for license terms.

Introduce `measure_doc_assets` to generate upgrade-specific documentation tables, figures, and a manifest from cached plotting data. Wire it into `ComStockMeasureComparison` behind a new opt-in flag, document the workflow in `compare_upgrades.py.template`, and add focused pytest coverage plus pytest discovery for the new module.
Add every fuel total and the total utility bill to the plotting columns so exported caches retain those totals. Update export logic to rebuild missing totals from their component columns when working with older caches, and record that in the manifest notes. Add tests covering the new plotting columns and compatibility with older cache exports.
@ChristopherCaradonna ChristopherCaradonna added documentation PR improves or adds documentation postprocessing PR improves or adds postprocessing content labels Oct 2, 2026
@ChristopherCaradonna
ChristopherCaradonna requested a balanced review from Copilot October 2, 2026 14:41

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.

Copilot review overview

🟡 Changes recommended

Nonstandard baseline IDs produce incorrect figures, and failed directory replacement can destroy valid prior assets.

Review effort: Balanced
Findings: 2 High severity

Open (2)
What changed in this PR

Adds opt-in generation of measure-documentation tables, figures, and manifests from ComStock plotting data.

Changes:

  • Adds asset generation and CLI support.
  • Integrates generation into measure comparisons.
  • Adds required plotting columns and tests.
File Description
postprocessing/​comstockpostproc/​measure_doc_assets.py Generates documentation assets.
postprocessing/​comstockpostproc/​comstock.py Retains required plotting totals.
postprocessing/​comstockpostproc/​comstock_measure_comparison.py Adds opt-in export integration.
postprocessing/​compare_upgrades.py.template Documents export configuration.
postprocessing/​test/​test_measure_doc_assets.py Tests asset generation.
postprocessing/​pytest.ini Registers the new tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

doc_assets exports now reject comparisons against any baseline other than ComStock upgrade 0, matching how savings columns are computed. The export process also keeps the current folder intact on failures, restores interrupted swaps, and cleans up stale partial/previous leftovers. CLI validation and tests were updated to cover the stricter baseline requirement and atomic swap behavior.
savings_distributions.csv now converts the site EUI savings columns from the
plotting data's kWh/ft2 to kBtu/ft2, with the conversion the EUI violin plots
use, so each row matches its figure. When the plotting code predates that
conversion, the manifest notes that the EUI figures plot kWh/ft2 values on
kBtu/ft2 axes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation PR improves or adds documentation postprocessing PR improves or adds postprocessing content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants