Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ResStock Technical Reference Guide #1338

Merged
merged 40 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
495cfa2
Initial commit of the ResStock Technical Reference Guide
afontani Jan 9, 2025
1353e45
Update name of docs folder
afontani Jan 9, 2025
984e104
Fix compiling errors on Overleaf
afontani Jan 9, 2025
78ce759
Add github action
afontani Jan 9, 2025
e03b534
Temporarily ignore other jobs
afontani Jan 10, 2025
c27fd5d
Add a working directory
afontani Jan 10, 2025
b8c3b9d
More temporary comments
afontani Jan 10, 2025
bf3d702
Try a different Textlive package
afontani Jan 10, 2025
4b1ad98
Try continuing
afontani Jan 10, 2025
60916b7
Switch action
afontani Jan 10, 2025
d7ef55d
rename main
afontani Jan 10, 2025
af9094e
ignore aux files commit pdf
afontani Jan 10, 2025
82074cc
Latest results.
Jan 10, 2025
e302f7d
Ignore the aux files
afontani Jan 10, 2025
43b6dfb
Latest results.
Jan 10, 2025
aa6e422
Remove pdf artifact
afontani Jan 10, 2025
824c617
More aux files
afontani Jan 10, 2025
9e6510a
Latest results.
Jan 10, 2025
9ab0c55
Update PR template
afontani Jan 10, 2025
387486f
Delete files
afontani Jan 10, 2025
378ad4e
Latest results.
Jan 10, 2025
642eca8
Update changelog
afontani Jan 10, 2025
355471e
Uncomment ci workflow jobs
afontani Jan 10, 2025
b9ae4f3
Fix
afontani Jan 10, 2025
b4a476b
Latest results.
Jan 10, 2025
984a476
Add ubuntu 22.04 dockerfile
afontani Jan 15, 2025
4d2aeb1
Add README for building document locally
afontani Jan 15, 2025
264208b
Make PR either update the reference or developer guide.
afontani Jan 16, 2025
6b0e5b1
Rename read_the_docs to technical_development_documentation
afontani Jan 16, 2025
1a9e454
fix changelog
afontani Jan 16, 2025
51ee655
update .gitignore
afontani Jan 16, 2025
0007f6d
rename documentation to guide
afontani Jan 16, 2025
fd889a1
update paths in .readthedocs.yml
afontani Jan 16, 2025
2fc48b6
Add technical development guide README.md
afontani Jan 16, 2025
47cf1dd
Latest results.
Jan 16, 2025
a2ce45d
Minor updates.
joseph-robertson Jan 16, 2025
1f389c3
One more minor update.
joseph-robertson Jan 16, 2025
68e2891
Latest results.
Jan 17, 2025
6182fe9
Do not commit TRG, upload as artifact
afontani Jan 21, 2025
e20406b
Remove TRG from committed files
afontani Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
## Checklist

#### Required:
- [ ] [Technical reference documentation](https://github.com/NREL/resstock/tree/develop/docs/read_the_docs) has been updated
- [ ] Add to the [changelog_dev.rst file](https://github.com/NREL/resstock/tree/develop/docs/read_the_docs/source/changelog/changelog_dev.rst)
- [ ] No unexpected regression test changes on CI (comparison artifacts have been checked)
- [ ] Update documentation (one is required)
- [ ] [Technical reference guide](https://github.com/NREL/resstock/tree/develop/docs/technical_reference_guide)
- [ ] [Technical development guide](https://github.com/NREL/resstock/tree/develop/docs/technical_development_guide)

#### Optional (not all items may apply):
- [ ] Tests (and test files) have been updated
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,20 +349,28 @@ jobs:
path: test/tests_yml_files
name: precomputed_buildstocks

- name: Build documentation
- name: Build technical development guide
run: |
sudo gem install oga
ruby docs/read_the_docs/source/workflow_inputs/create_characteristics_rst.rb
ruby docs/read_the_docs/source/workflow_outputs/csv_tables.rb
cd docs/read_the_docs
ruby docs/technical_development_guide/source/workflow_inputs/create_characteristics_rst.rb
ruby docs/technical_development_guide/source/workflow_outputs/csv_tables.rb
cd docs/technical_development_guide
pip install changelog
make html SPHINXOPTS="-W --keep-going -n"
afontani marked this conversation as resolved.
Show resolved Hide resolved

- name: Build technical reference guide
uses: dante-ev/latex-action@2023-A
with:
working_directory: docs/technical_reference_guide
root_file: ResStockTechnicalReferenceGuide.tex

- name: Save Docs
- name: Save documentation
uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/read_the_docs/_build/html/
path: |
docs/technical_development_guide/_build/html/
docs/technical_reference_guide/ResStockTechnicalReferenceGuide.pdf

- name: Commit latest results
shell: bash
Expand Down
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
/docs/read_the_docs/_build
/docs/technical_development_guide/_build
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.aux
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.bcf
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.lof
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.log
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.lot
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.out
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.pdf
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.run.xml
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.toc
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.upa
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.bbl
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.blg
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.fdb_latexmk
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.fls
/docs/technical_reference_guide/ResStockTechnicalReferenceGuide.upb
/lib
/measures/UpgradeCosts/tests/in*
/measures/UpgradeCosts/tests/*.xml
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

sphinx:
configuration: docs/read_the_docs/source/conf.py
configuration: docs/technical_development_guide/source/conf.py

build:
os: "ubuntu-22.04"
Expand All @@ -10,4 +10,4 @@ build:

python:
install:
- requirements: docs/read_the_docs/requirements.txt
- requirements: docs/technical_development_guide/requirements.txt
File renamed without changes.
53 changes: 53 additions & 0 deletions docs/technical_development_guide/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# ResStock Technical Development Guide

This folder contains the Read The Docs project for the ResStock Technical Development Guide.

## GitHub Actions
In the `.github/workflows/config.yml` file, the `updates-results` job `Build technical development guide` task compiles the project into the `_build/html` folder.
This folder is then uploaded in the `Save technical development guide` task.
These actions will help keep the document up to date with any changes and fail in the tests if the document does not compile.

## Building Technical Development Guide Locally

### Windows

1. With the terminal/command prompt navigate to the resstock repository technical development guide directory.

```
cd <RESSTOCK_DIR>/docs/technical_development_guide
```

2. Install sphinx Read The Docs theme

```
pip install sphinx_rtd_theme
```

3. Build the documentation. HTML files will be created in the `docs/technical_development_guide/_build` directory

```
./make.bat html SPHINXOPTS="-W --keep-going -n"
```

### Mac

1. With the terminal/command prompt navigate to the resstock repository technical development guide directory.

```
cd <RESSTOCK_DIR>/docs/technical_development_guide
```

2. Install sphinx Read The Docs theme and Sphinx Auto-build

```
pip install sphinx_rtd_theme
pip install sphinx-autobuild
```

3. Build the documentation. HTML files will be created in the `docs/technical_development_guide/_build` directory.

```
sphinx-autobuild source _build source/index.rst
```

4. The previous step will connect a server which can be opened in a browser. This server might look something like `http://127.0.0.1:8000`. Copy the address into your browser and the built documentation will show up. The `sphinx-autobuild` command will continue to check for changes to the documentation. So after future changes, the page in the browser should automatically reload to see changes to the source files.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,27 @@ Development Changelog
:version: v3.5.0
:released: pending

.. change::
:tags: ci, docs, technical reference guide, technical development guide
:pullreq: 1338
:tickets: resstock-estimation 437

**Date**: 2025-1-11

Title:
Add ResStock Technical Reference Guide

Description:
Add the ResStock Technical Reference Guide to the repository and compile it on github actions to keep the pdf up to date.

Assignees: Anthony Fontanini

.. change::
:tags: feature, characteristics
:pullreq: 1325
:tickets: resstock-estimation 437

**Date**: 2024-11-19
**Date**: 2024-12-30

Title:
Well pump distribution using AHS
Expand All @@ -22,6 +37,7 @@ Development Changelog

Assignees: Lixi Liu

.. change::
:tags: characteristics, pool heater
:pullreq: 1324

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def setup(app):
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ResStock.tex', u'ResStock Documentation',
(master_doc, 'ResStock.tex', u'ResStock Technical Development Guide',
u'NREL', 'manual'),
]

Expand All @@ -164,7 +164,7 @@ def setup(app):
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'resstock', u'ResStock Documentation',
(master_doc, 'resstock', u'ResStock Technical Development Guide',
[author], 1)
]

Expand All @@ -175,7 +175,7 @@ def setup(app):
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ResStock', u'ResStock Documentation',
(master_doc, 'ResStock', u'ResStock Technical Development Guide',
author, 'ResStock', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

ResStock Documentation
======================
ResStock Technical Development Guide
====================================

.. note::
Most people who use ResStock for analysis do so by using the datasets published to the `ResStock Data Viewer <https://resstock.nrel.gov>`_.
Expand Down
37 changes: 37 additions & 0 deletions docs/technical_reference_guide/1_Introduction.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
\chapter{Introduction}

ResStock\textsuperscript{TM} is the foundational national residential building stock energy model for the United States. ResStock is a highly granular, bottom-up, physics-based model that uses best-available data sources on American housing, statistical sampling methods, and advanced building energy simulations in EnergyPlus\textsuperscript{\textregistered} to model the annual subhourly energy consumption of the residential building stock across the United States with high spatial granularity. ResStock's companion model, ComStock, covers the commercial building stock of the United States.

Many of the internal workings of these models are distinct, but the results and types of analyses that can be done with them are similar. Documentation for ComStock can be found on the \href{https://nrel.github.io/ComStock.github.io/}{ComStock website}.

ResStock represents all types of housing units, including single-family, multifamily, and manufactured or mobile homes. The definition of the residential sector follows the U.S.~Energy Information Administration's (EIA) definition of \textit{housing unit} and therefore does not include dormitories, prisons, assisted care facilities, and other congregate housing situations, but does include high-rise multifamily buildings that are sometimes considered commercial buildings for the purpose of building codes~\citep{eia_recs2024}.

This report serves as the primary documentation of the methodology and assumptions of ResStock. It is updated with each ResStock software release or ResStock standard data release.

\section{Overview and Primary Use Applications}

ResStock answers two primary questions: (1) How and when is energy used in the U.S.~residential building stock? and (2) What are the impacts of technological and behavioral changes in U.S.~homes? Specifically, ResStock quantifies energy use across geographical locations, demographic groups, building types, fuels, end uses, and time of day. Additionally, it details the impact of efficiency, fuel changes, or flexibility measures: total changes in the amount of energy used by measure; where or in what use cases efficiency or technology change measures save energy; when or at what times of day savings occur; and which building stock or demographic segments have the biggest savings potential.

This type of building stock energy model can be conducted using a range of approaches, varying on a spectrum from simple representation and fast execution or complex representation and slow execution. Each approach has benefits and trade-offs. The National Energy Modeling System used by the EIA is an example of a simple, fast method. This system models the entire U.S.~energy system at the census region level, and its results for the building stock have low spatial, temporal, and subsector granularity. On the other hand, modeling each individual building within the building stock is an example of a complex, slow method. This approach is impossible to implement in practice due to the lack of building-level data necessary to develop the model, and can lead to false confidence in results if not underpinned by appropriate data. Additionally, if appropriate data did exist and the model could be developed, this approach would offer a high granularity of results, but gives more detail than is needed for most applications and is highly impractical to update or run frequently.

The ResStock approach is positioned between these two extremes, providing highly granular housing stock data to capture the diversity of housing and occupants while maintaining a usable execution speed. Three advantages of the ResStock approach are: (1) subhourly detail; (2) modeling of upgrade measure interaction, controls, and demand flexibility; and (3) the ability to post-process the data to slice results (e.g., by location, household income, fuel types, building size) and extract a wide array of insights from the simulations, including distributional impacts---how costs and benefits are distributed across different groups of households. This approach strikes a balance by presenting enough information to answer its two driving questions while remaining computationally tractable.

Professionals and researchers have several pathways for using ResStock data and insights. They can review published fact sheets and reports based upon ResStock data, query a web-based visualization platform to view annual and timeseries results, or use a simple spreadsheet-type analysis to investigate annual energy consumption results and aggregated timeseries load profiles. If users want to go deeper, they can use the raw simulation results dataset, which requires comfort dealing with large datasets and potentially cloud or high-performance computing assets. All of these approaches to using ResStock are supported by the ResStock team, which can be contacted at \\
\href{mailto:[email protected]}{[email protected]}. Because all ResStock inputs are publicly available, it is also theoretically possible for users to run ResStock themselves using their own computing resources and weather files. However, the ResStock team is not able to provide support for external users running ResStock software because of the significant burden it would impose on staff time and budget. We encourage users to use the publicly released datasets, visualizations, and analysis products that receive rigorous review for quality assurance and control.

\section{ResStock Calibration and Validation}
Calibration and validation have been core components of ResStock since its inception. In 2014, initial validation efforts focused on comparing estimates of average annual electricity and gas use per home to EIA Residential Energy Consumption Survey (RECS) 2009 microdata for cohorts of single-family detached homes grouped by combinations of region, vintage, and fuel type (see Section 2.6 in \cite{Wilson2017}). Visual comparisons of cumulative distribution functions for energy use, along with Kolmogorov–Smirnov tests for goodness of fit, were used to validate heterogeneity in model outputs. In 2015, the initial year-long calibration effort involved 12 rounds of model structure and input modifications to improve agreement with RECS 2009 data. Examples of these modifications include: adding new data sources for probability distributions, changing dependencies for housing characteristic probability distributions, changing the number of probability distribution options, and reducing the number of weather locations (to allow additional granularity in other areas).

Calibration and validation efforts expanded to include hourly timeseries outputs in 2019--2022. As part of a three-year U.S. Department of Energy (DOE)-funded project, we compared ResStock results to data from a wide range of sources such as utility load research data, advanced metering infrastructure data, and end-use submetered data to inform modeling improvements, and validated the updated model. ComStock also went through this process as part of the same project. These data sources, as well as the comparison plots and accompanying discussion, are described in detail in that project’s final report \citep{Wilson2022}. Since the publication of that report, additional modifications have been made to ResStock. These ongoing modifications are documented in this report.

% Validation of individual technology models, e.g., ASHPs

\section{ResStock Data Access}

Access to ResStock data is provided in multiple formats. The current state of data access changes periodically and is maintained at the National Renewable Energy Laboratory (NREL) \href{https://resstock.nrel.gov/datasets}{ResStock website}.


% PRIORITY B: \section{ResStock history (brief)}
% Talk about previous versions

% PRIORITY C: \section{Previous releases, timeline with links}
Loading