Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
2fe99c1
Merge pull request #4 from ReEDS-Model/km/update-links
kennedy-mindermann Apr 30, 2026
550e815
Update aeo_updates/natural_gas_price_regression/aeo_pipeline_config.json
Yunzhi-Chen May 12, 2026
e61a0d5
Merge branch 'yc/natural_gas_update' of https://github.com/ReEDS-Mode…
Yunzhi-Chen May 12, 2026
8f15643
Fix stale filename references
Yunzhi-Chen May 12, 2026
d1eb5f4
Update aeo_updates/natural_gas_price_regression/visualization.py
Yunzhi-Chen May 12, 2026
ba50fd1
Update aeo_updates/natural_gas_price_regression/.gitignore
Yunzhi-Chen May 12, 2026
bb3aa74
Revert "Update aeo_updates/natural_gas_price_regression/aeo_pipeline_…
Yunzhi-Chen May 12, 2026
b154384
Sort region in alphabetic sequence
Yunzhi-Chen May 12, 2026
ae18ddb
Update aeo_updates/natural_gas_price_regression/inputs for alpha regr…
Yunzhi-Chen May 14, 2026
03fc4de
Update README.md
Yunzhi-Chen May 14, 2026
aa41d33
Merge pull request #5 from ReEDS-Model/AEO_2026
wesleyjcole May 19, 2026
0a34df7
Pull historical natural gas price, demand and total demand from AEO d…
Yunzhi-Chen May 19, 2026
05cfc3c
Update README.md
Yunzhi-Chen May 19, 2026
1c891a8
Revert "Update README.md"
Yunzhi-Chen May 19, 2026
0d962fe
Revert "Pull historical natural gas price, demand and total demand fr…
Yunzhi-Chen May 19, 2026
b55edb2
Fix historical year dollar year issue
Yunzhi-Chen May 19, 2026
d043cf7
Merge pull request #2 from ReEDS-Model/yc/natural_gas_update
Yunzhi-Chen May 19, 2026
b7d1037
Merge branch 'main' into yc/natural_gas_update_2026
Yunzhi-Chen May 19, 2026
f08e401
Delete national_beta.csv
Yunzhi-Chen May 19, 2026
a50bc40
Update readme and historical info
Yunzhi-Chen May 19, 2026
d173649
Update aeo_pipeline_config.json
Yunzhi-Chen May 28, 2026
5940f9a
Merge pull request #3 from ReEDS-Model/yc/natural_gas_update_2026
Yunzhi-Chen Jun 2, 2026
6b7e84c
Fix formatting issues in README.md
wesleyjcole Jun 8, 2026
f0da5ff
Merge pull request #7 from ReEDS-Model/wesleyjcole-patch-1
wesleyjcole Jun 9, 2026
73cffd8
Add temperature - gas price regression workflow
kodiobika Jun 11, 2026
4a572b3
Remove unused imports, add clarifying comments, and export to 'output…
kodiobika Jun 23, 2026
731d24c
Remove intermediate input file
kodiobika Jun 23, 2026
eb6584e
Update README.md
kodiobika Jun 23, 2026
b5b8638
Add .gitignore
kodiobika Jun 23, 2026
4abf7f1
Clarify README
kodiobika Jun 23, 2026
48eb977
Clarify README
kodiobika Jun 23, 2026
7cd0bc1
Update .gitignore
kodiobika Jun 23, 2026
9d135b5
Remove extraneous data sources and update degree day calculation
kodiobika Jul 7, 2026
f47dbfc
Delete unneeded file
kodiobika Jul 7, 2026
da1825a
Cleanup
kodiobika Jul 7, 2026
8255b24
Update README.md
kodiobika Jul 7, 2026
deaf252
Shorten name of regression params file
kodiobika Jul 7, 2026
0b0e5d8
Rename folder
kodiobika Jul 7, 2026
b70dca8
Update aeo_updates/temperature_gas_price_adj_regression/calculate_reg…
kodiobika Jul 8, 2026
6bf7d19
Bugfix
kodiobika Jul 8, 2026
749f83c
Merge pull request #8 from ReEDS-Model/ko/temp_gasprice_regression
kodiobika Jul 8, 2026
aa11388
Initial code migration
Yunzhi-Chen Aug 5, 2026
73f0431
Minimum code fix
Yunzhi-Chen Aug 5, 2026
e036f09
Update settings.yaml
Yunzhi-Chen Aug 5, 2026
19d7373
Update .gitignore
Yunzhi-Chen Aug 5, 2026
6da6d52
Restructure the code
Yunzhi-Chen Aug 6, 2026
dadd19b
Restructure ATB inputs: raw scraped_input, runtime battery extraction
Yunzhi-Chen Aug 6, 2026
48ca1b2
Ignore ATB manual_input data files (keep local only)
Yunzhi-Chen Aug 6, 2026
8ebb8a9
Create atb_2024_flat_file.csv
Yunzhi-Chen Aug 11, 2026
22f25b7
reconstruct the code
Yunzhi-Chen Aug 11, 2026
04d2901
clean up
Yunzhi-Chen Aug 12, 2026
5244331
update
Yunzhi-Chen Aug 12, 2026
d42da36
clean up
Yunzhi-Chen Aug 13, 2026
a9ec539
clean up
Yunzhi-Chen Aug 13, 2026
cdf2c0f
update
Yunzhi-Chen Aug 17, 2026
9413a82
Update README.md
Yunzhi-Chen Aug 17, 2026
770cf15
Add historical costs
Yunzhi-Chen Aug 26, 2026
88e4ad6
Add historical costs
Yunzhi-Chen Aug 26, 2026
0ff07aa
update
Yunzhi-Chen Sep 1, 2026
4f1f4ba
update
Yunzhi-Chen Sep 2, 2026
41b94db
clean up
Yunzhi-Chen Sep 2, 2026
d195c93
Merge remote-tracking branch 'origin/main' into yc/24ATB
Yunzhi-Chen Sep 2, 2026
f5a0631
Fix gas H frame stuffs
Yunzhi-Chen Sep 2, 2026
5a6b7ed
update
Yunzhi-Chen Sep 3, 2026
6cec19d
Update atb_plotting.py
Yunzhi-Chen Sep 5, 2026
1454d62
Recovers atb_plotting using An's code
Yunzhi-Chen Sep 5, 2026
4bcdd21
add historical cf and csp costs
Yunzhi-Chen Sep 8, 2026
feefd46
add historical battery costs
Yunzhi-Chen Sep 9, 2026
d0eb828
Add atb as estimated historical
Yunzhi-Chen Sep 9, 2026
dc60af5
refine historical data
Yunzhi-Chen Sep 9, 2026
e7032c5
Update config.yaml
Yunzhi-Chen Sep 9, 2026
42210e2
Merge branch 'main' into yc/24ATB
Yunzhi-Chen Sep 9, 2026
96d0b75
Add real historical costs by scraping nuclear plants of Watts Bar and…
Yunzhi-Chen Sep 12, 2026
336b423
Apply CAPEX to OCC factor to real historical costs
Yunzhi-Chen Sep 14, 2026
324522f
Enhance historical data processing
Yunzhi-Chen Sep 15, 2026
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
26 changes: 23 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
log.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file needs to be updated

*.gdx
*.lst
gens_fixme.csv

# atb files
ATB/inputs/
atb/output/
atb/inputs/
atb/figures/
/nems_database_processing/outputs/
/aeo_updates/outputs/
atb/figures/*
atb/comparison/*
!atb/comparison/README.md
!atb/comparison/compare_atb_outputs.py
atb/_dev/
atb/scraped_input/*
!atb/scraped_input/README.md
atb/manual_input/csp_cost_ratios_2025.csv

# Legacy CF source; final historical CF multipliers now live in historical/.
/NEMS_database_processing/Outputs/
/AEO_Updates/outputs/
/AEO_Updates/output/AEO_HIGHMACRO_2021_electricity_consumption.csv
/AEO_Updates/output/AEO_HIGHOGS_2021_ng_prices.csv
/AEO_Updates/output/AEO_LOWMACRO_2021_electricity_consumption.csv
/AEO_Updates/output/AEO_REF2021_2021_electricity_consumption.csv
/AEO_Updates/output/AEO_REF2021_2021_ng_prices.csv

# pyc files
*.pyc
*__pycache__
Expand Down
131 changes: 123 additions & 8 deletions atb/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,125 @@
# Overview
This repo includes scripts to plot CAPEX, FOM, and VOM of different versions of the ATB.
# ATB inputs for ReEDS

# Required inputs
Users are required to provide Users have the options to provide the ATBe.csv file for the specific ATB version they want to plot. THere are two options to provide ATBe.csv file:
- Save the file in the ATB/inputs folder
- Provide an URL to the ATBe.csv file. If choose URL option, users are prompted to provide the URL.
Run from `atb/` after checking paths and the ATB release in `config.yaml`:

# Note
This script was tested on ATB 2024 and 2025 versions only, so they may not work for earlier versions.
```bash
python scripts/future_atb_scraper.py
python scripts/run_pipeline.py
```

The downloader caches the configured ATB flat file and workbook. The pipeline
formats projections, joins prepared history, applies configured smoothing, and
creates plots. It never downloads data or rewrites historical inputs. Use
`--only format` to generate CSVs without plots. Outputs go to `output/`;
`processing.copy_to_reeds` controls copying them into ReEDS.

## Historical inputs

The three versioned tables in [`historical/`](historical/README.md) are sufficient
for historical processing; users do not need the historical raw downloads.
The defaults use observed data wherever a reviewed source exists (`real`, or
`indexed` for O&M), hold the first ATB projection value flat otherwise
(`broadcast`), and write the ReEDS placeholder before a technology's first
buildable year (`unavailable`). Archived ATB estimates (`atb`) and the ReEDS
ATB 2024 baseline (`manual`) remain selectable per metric in `config.yaml`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

baseline or moderate? and should it be stuck to 2024 or alter with the ATB being processed? I'm not sure about calling this 'manual' either as that doesn't help understand what is being done.


To rebuild history from original sources:

```bash
python scripts/historical_data_scraper.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming we get new historical data each year we would need to rerun this each time, right? If so I'd put this above the previous steps, which an explanation of the steps needed to add additional years of historical data.

```

Use `--no-download` to rebuild from cached raw files, or `--force` to replace
cached downloads. Preparation downloads observed sources and historical ATB
releases, including the configured current release. It writes all three CSVs
only after extraction and preparation succeed. Review their changes before
committing them. Manual values always come from the ReEDS **ATB 2024** files.

Each metric's history mode is set per technology in `config.yaml`:

- `real`: observed anchors from `historical/real.csv`, interpolated between
anchors and carried back before the first.
- `indexed`: ATB's value at `index_reference_year` scaled by an observed
index; used for wind-ons and upv FOM, whose surveys report a partial-scope
level but a usable trend.
Comment on lines +43 to +44

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase "whose surveys report a partial-scope level but a usable trend" doesn't make sense to me.

- `unavailable`: a placeholder cost (`unavailable_value`, 99999) for years
before the technology's first buildable year, declared per technology in
`unavailable_before`; used for fuel cells, nuclear-SMR, floating offshore,
and CCS. The placeholder is written last, after every dollar-year step, and
never lives in `manual.csv`. It is a marker, not the barrier: ReEDS blocks
investment before its own `firstyear`, so the value only needs to be far
above any real cost (ReEDS's own files use 9999, which is below Vogtle).
- `atb`, `manual`, `broadcast`: archived ATB estimates, the ReEDS ATB 2024
baseline, or the first projection value held flat.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By baseline do you mean moderate? And I think it would be better call the broadcast option "backfill".


Technologies with only a few builds use plant-level project files under
`manual_input/` (nuclear, fixed offshore). The scraper writes a coverage table
into `historical/README.md` showing every metric's mode, source, and anchors.

Archived anchors use exactly `historical year = ATB release year - 2`.
Formatting interpolates missing years, carries the first anchor backward before
coverage, and interpolates from the last anchor to the first projection year.
That last rule matters where ATB omits a technology until 2030 (nuclear,
nuclear-SMR, floating offshore): the curve rises to meet ATB instead of holding
flat and then stepping. These fills are estimates, not additional annual ATB
observations.
ATB history uses Moderate estimates across output scenarios.

`processing.smooth_cost_curves.fill_atbstartyear2atbyear_with_real: true`
also replaces ATB points through the release year for metrics selected as
`real` (2022-2024 for ATB 2024): every year from the series start through the
last observed or calculated anchor, with years between anchors on the straight
line between them. ATB resumes only after the last anchor. This runs after
smoothing and can be overridden per technology. Plots label the replacement
sources.

During an annual update, update the configured release, URLs, dollar year and
technology mappings, download future ATB, then rerun historical preparation to
add the new release's base year. Previous releases are recovered from the
prepared table's provenance or the cached manifest. Pipeline runs alone never
add historical data. ATB schema or technology changes still require review.

The default projection start follows `atb.year - 2`; individual series retain
their actual start year. Financial cases can be changed in config without
editing `settings.yaml`. To match `yc/25ATB`, use:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the README be hardcoded with a reference to a branch?


```yaml
processing:
atb_case: R&D
atb_case_overrides: {upv: Exp, wind-ons: Exp, battery: Exp}
```

With ATB 2025 configured, the real-data overlap becomes 2023-2025 automatically;
years without source observations stay ATB. Release URLs, dollar year, and
year-specific future adjustment files still need the normal annual update.

## Data treatment

- Monetary history is stored in `historical_data.dollar_year` and converted to

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean? I don't see a dollar_year file in the historical data folder, and this isn't reference anywhere in the code

the output dollar year with the ReEDS deflator. Nonmonetary rows have no
dollar year.
- Observed capital costs are reported on wider boundaries than ReEDS `capcost`,
which is the ATB overnight capital cost. Each scraped cost declares a
`cost_scope`, and preparation removes the grid connection and, where the source
is an as-spent project cost, the construction financing, using ATB components
from `historical_data.reference_atb_year`. Configure this under
`historical_cost_sources.cost_scope_adjustment`; see
[`historical/README.md`](historical/README.md) for the per-source boundaries
and the offshore-wind caveat.
- Real and archived capacity factors remain fractions in the prepared files;
formatting divides them by the current ATB reference capacity factor.
- Battery power and energy costs are estimated from observed total cost and
cohort duration while preserving ATB reference component proportions.
- CSP configuration costs use the same ratio method as projections. Historical
reference ratios and the battery split workbook are pinned by
`historical_data.reference_atb_year` (2024), independently of future updates.
- The manual baseline retains complete ReEDS curves for retired designs and
broadcast reference values. These are labeled manual, including future
reference rows; they are not claimed as measured historical costs.

The scraper pulls ReEDS baseline curves, `dollaryear.csv`, and the financial
deflator from GitHub at the commit pinned in `reeds_source.ref`, so rebuilding
history needs no local ReEDS checkout. A local repository is still needed for
comparison baselines and optional copying. Technology formatting rules are in
`scripts/settings.yaml`; review year-specific files under `manual_input/`
when changing the ATB release.
54 changes: 54 additions & 0 deletions atb/comparison/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Local ATB output comparison

The comparison utility is versioned; the plots it generates are not. Both plot
directories are ignored by Git, so rerun the pipeline to regenerate them.

For validation plus before/after smoothing figures, run formatting and
comparison together from `atb/`:

```bash
python scripts/run_pipeline.py --only format compare
```

When the full pipeline runs formatting and comparison together, it captures
fully processed files just before smoothing in a temporary directory. The
comparison script validates those files against the matching source files in
the ReEDS repository configured in `../config.yaml`, then the temporary files
are deleted automatically. Thus smoothing differences do not obscure scraper
and formatting validation. The script normalizes legacy wind filenames and
column names, then checks:

- missing files and columns;
- duplicate keys;
- rows present on only one side;
- changed values using configurable numeric tolerances.

Only plots are written, under `comparison/plot_comparison/`:

- `comparison_overview.png` summarizes file-level validation status;
- one time-series plot is written for each generated/ReEDS file pair.

Detailed comparison statuses and reverse-coverage gaps are printed to the
terminal instead of being written as CSV reports. In these local plots, solid
lines are the unsmoothed generated baseline and dashed lines are ReEDS.

Running `python comparison/compare_atb_outputs.py` by itself compares the final
files already in `output/` with ReEDS. It cannot regenerate before/after plots
because the temporary pre-smoothing data is intentionally not retained.

The full pipeline also compares the temporary unsmoothed data with the final
smoothed outputs. Those plots are written to `plot_component/`, which lets
reviewers see the smoothing effect without retaining duplicate CSV outputs. Final processed
values are lines, while solid dots identify input data values. Manual history
and directly observed real history receive dots; broadcast history and filled
real-history years do not. Future dots show the raw ATB values, while the line
shows the final raw or smoothed trajectory. A selected manual or broadcast
history uses one color for its entire historical curve. Real history uses green
for observations and orange for years filled from that same real series; an
internal gap is linearly interpolated. Gray and gold distinguish raw and
smoothed ATB projections. A dotted vertical line marks the configured
projection start year; line styles distinguish technology series. Each interval
takes the color of the year it ends in, so a new source color appears on the
interval that reaches its first year. The one exception is the interval leaving
the last historical year: it keeps the historical color, so the step into the
first projection year still reads as history.
Loading