Skip to main content

Calibrates a residential building energy model to utility bills.

Project description

OpenStudio™ HPXML Calibration

ci

A package to automatically calibrate an OpenStudio-HPXML residential building model against utility bills.

The implementation relies heavily on BPI-2400-S-2015 v.2 Standard Practice for Standardized Qualification of Whole-House Energy Savings Predictions by Calibration to Energy Use. However, it is not currently a complete implementation of BPI-2400.

Documentation & usage

Full documentation is available at https://NREL.github.io/OpenStudio-HPXML-Calibration

Create a custom config file (based on default_calibration_config.yaml) that is specific to the home being calibrated.

Then run: uv run openstudio-hpxml-calibration calibrate --hpxml-filepath hpxml.xml --config-filepath my_config.yaml

See uv run openstudio-hpxml-calibration calibrate --help or uv run openstudio-hpxml-calibration --help for more options.

Developer installation

  • Clone the repository: git clone https://github.com/NREL/OpenStudio-HPXML-Calibration.git

  • Move into the repository: cd OpenStudio-HPXML-Calibration

  • Install OpenStudio 3.10.0

  • Uv is used to manage the project & dependencies (and may also be used to manage Python if you want). After cloning, ensure you have uv installed, then run uv sync to install the package and all development dependencies.

    • Some Windows developers have reported version conflicts using the default strategy. If this occurs, consider changing the resolution strategy using uv sync --resolution=lowest-direct
  • Download all weather files using uv run openstudio-hpxml-calibration download-weather

  • Developers can then call uv run pytest to confirm all dev dependencies have been installed and everything is working as expected. (If you need to restrict the number of concurrent workers, you can use e.g. uv run pytest -n <NUM>.)

  • Activate pre-commit (only required once, after cloning the repo) with: uv run pre-commit install. On your first commit it will install the pre-commit environments, then run pre-commit hooks at every commit.

  • Before pushing to Github, run pre-commit on all files with uv run pre-commit run -a to highlight any linting/formatting errors that will cause CI to fail.

  • Pycharm users may need to add Ruff as a 3rd-party plugin or install it as an external tool to their IDE to ensure linting & formatting is consistent.

  • Developers can test in-process functionality by prepending uv run to a terminal command. For instance, to see the CLI help menu with local changes not yet committed, run: uv run openstudio-hpxml-calibration --help

Alternative Dev Container Environment

There's a Dev Container configuration in this repo which installs all the necessary dependencies in a docker container and attaches to VSCode to it. To use it:

  • Install VSCode
  • Install the Dev Containers extension.
  • Install Docker Desktop or something compatible.
  • Click the little blue "><" icon in the lower left of VSCode, and select "Reopen in Container". The window will reload. It may take a few minutes the first time.

Testing

Project tests can be run with uv run pytest from the repo root. (If you need to restrict the number of concurrent workers, you can use e.g. uv run pytest -n <NUM>.)

Ruby Measure tests can be run with openstudio src/measures/ModifyXML/tests/modify_xml_test.rb

Developing documentation

During development we can serve docs locally and view updates as they are made.

  1. Start a documentation update branch: git switch -c <branch_name>
  2. uv run mkdocs serve
  3. Point browser to http://127.0.0.1:8000/
  • To deploy, push a commit in the docs folder to the main branch
  • Wait a few minutes, then verify the new documentation on the docs website

License

This project is available under a BSD-3-like license, which is a free, open-source, and permissive license. For more information, check out the license file.

This project is NREL Software Record SWR-25-94

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openstudio_hpxml_calibration-0.1.0.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openstudio_hpxml_calibration-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file openstudio_hpxml_calibration-0.1.0.tar.gz.

File metadata

File hashes

Hashes for openstudio_hpxml_calibration-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e808f5e84fe1192dbd67a5cc9e4e78b95c5049498795a10e92ab39f04eb40379
MD5 293b36f175c985c9ddffd7eae5c98b26
BLAKE2b-256 d7b3cda2294aa4f03ff6c89cde3f331499da65c035047d5d30ffe04fd69c0fee

See more details on using hashes here.

File details

Details for the file openstudio_hpxml_calibration-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openstudio_hpxml_calibration-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6031c9dd2217c152d2002b68658bb75b2b56fbbbb98a2f64a3794aa09582618
MD5 607b6c05db4e2c3c291e4816bb5cf5c0
BLAKE2b-256 fe6a24013758172dafce58a6cd4ce55cbde454efd1cf23321c973f958e2cac35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page