Skip to content

Compare the extracted costs with Berkeley Lab's PJM cost data - #13

Merged
aymanazeem merged 4 commits into
mainfrom
feat/compare-costs-with-berkeley-lab
Dec 1, 2026
Merged

aymanazeem merged 4 commits into
mainfrom
feat/compare-costs-with-berkeley-lab

Conversation

@aymanazeem

@aymanazeem aymanazeem commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Problem

python -m src.extract --validate looked for hand-read costs in the Queued Up spreadsheet, which has none, so it never compared anything.

What changes

  • --validate sets each extracted cost per kW beside the one in Berkeley Lab's PJM cost data (January 2023), which its researchers read by hand from PJM's studies of 1,127 projects. For each project in both, it prints the two costs, the difference (the extracted cost minus Berkeley Lab's), the megawatts each was divided by, and the study Berkeley Lab read. It calls no model.
  • The file is pinned by its address and SHA-256 checksum in src/config.py, like the Queued Up workbook. It is downloaded into data/raw/costs/ the first time there is a cost to compare, by the same checked download code as the workbook. It states no open licence, so Git ignores it.
  • It says so when there is nothing to compare, when the download fails or the file has another checksum, and when there is no panel yet.
  • The README explains the command, says it has nothing to compare until the paid extraction runs, and adds the file to the sources. A new entry in docs/decisions.md gives the alternatives, evidence and trade-offs, including why some gaps will be large. The future-work item this completes is gone.

Verification

  • Tests: 225 pass locally on Python 3.11, 3.13 and 3.14, with the lock's packages.
  • Planted bugs: the tests catch 7 of 7: no megawatt fallback; zero megawatts not treated as missing; Berkeley Lab's megawatts shown as the ones used; the difference the wrong way round; the covered count taken from the whole file; a checksum refusal not caught; and a missing panel not caught.
  • A real run. On a copy of the panel holding only the cost I read by hand from AF1-236's report, --validate downloaded the file from the pinned address into an empty folder, matched its checksum, and printed $391.35 per kW beside Berkeley Lab's $418.46, a difference of −$27.11, both divided by 1,210 MW.
  • Figures checked against their sources.
    • Berkeley Lab's file (SHA-256 50a36331…af245) gives the network costs quoted, and its codebook says only "using a gdp deflator".
    • AF1-236's report gives $4,200,000 of attachment facilities, $2,400,000 for two substation breakers and $473,529,878 of network upgrades. Berkeley Lab's figures equal these raised by 6.4%, with the breakers counted as network.
    • The cost summaries of AG1-330, AG1-335, AG1-336 and AG1-337 give "Total System Network Upgrade Costs $0". Berkeley Lab's total costs for them, and for AG1-322, equal the reports' totals raised by 2.1%, and it counts most of each as network cost.
  • Dry runs, on the full panel and the 25 default reports, none calling OpenAI: the setup check, extraction, --validate (nothing to compare, nothing downloaded), the evaluation and a question.
  • CI: run 46575510786 passed on Python 3.11 and 3.14, 225 tests each, with 0 billable milliseconds.

Not checked against OpenAI's live API

--validate calls no model, but it compares extracted costs, and there are none until the paid extraction runs. So it hasn't yet compared a cost the model extracted: the run above used one I read by hand.

Review

An earlier review, before this branch was rebuilt onto main, didn't finish. A fresh independent review of af7b223 and 24d1d8a found no blockers, two things to fix (an untested megawatt fallback, and a future-work sentence tying --validate to AC2-093, which Berkeley Lab doesn't cover), six minor points and some nits. d576e48 fixes all of them except one nit: a failed download still exits with status 0, as --validate did on main. These fixes had my review only.

python -m src.extract --validate looked for hand-read costs in the Queued Up
spreadsheet, which has none, so it never compared anything. It now sets each
extracted cost per kW beside the one in Berkeley Lab's PJM cost data (January
2023), with the difference, the megawatts each side divided by, and the study
Berkeley Lab read. The file is pinned by address and SHA-256 like the
workbook, downloaded into data/raw/costs/ the first time, and never
committed. The command calls no model.

The file covers 13 of the 25 default projects and AF1-236, and for all 14 the
downloaded report is the study Berkeley Lab read. Run on a scratch panel
holding the cost read by hand from AF1-236's report, it printed $391.35 per kW
beside Berkeley Lab's $418.46, both over 1,210 MW.
The --validate note said the extracted cost is in the dollars of the
study's own year. PJM's reports don't say so; Berkeley Lab assumes it
for PJM's studies. The note now says the cost is probably in the
study's year's dollars, as Berkeley Lab assumes.
…th-berkeley-lab

# Conflicts:
#	README.md
#	docs/future_work.md
An independent review found that no test covered the megawatts
--validate shows when a study omits them or gives zero, and that future
work tied --validate to AC2-093, which Berkeley Lab doesn't cover.

The validation test now covers both fallbacks. New tests check that a
file with another checksum is reported, and that --validate without a
panel says to build one rather than ending in a traceback. The output
says which way the difference runs and whose megawatts are whose.

The docs now say --validate has nothing to compare until the paid
extraction runs, and explain the gaps it will show. Most of AF1-236's
is Berkeley Lab's conversion to 2022 dollars, and for four default
projects whose reports give no network upgrades, the gap is all of
Berkeley Lab's figure. The sources link to the page that offers the
file.
@aymanazeem

Copy link
Copy Markdown
Owner Author

Evidence for d576e48, the head to be merged.

  • CI: the checks job passed on Python 3.11 and 3.14 in run 46575510786, 225 tests each, with 0 billable milliseconds (from gh api repos/aymanazeem/Interconnection-Queue-Agent/actions/runs/46575510786/timing).

  • Locally: 225 tests pass on Python 3.11, 3.13 and 3.14, with the lock's packages and the current main merged in.

  • Planted bugs: 7 of 7 caught, each on its own in a copy of the code, as listed in the description.

  • A real run: --validate on a copy of the panel holding only AF1-236's hand-read cost downloaded Berkeley Lab's file into an empty folder, matched the pinned checksum and printed:

    queue_id      extracted  Berkeley Lab  difference   MW used  Berkeley Lab MW  Berkeley Lab's study
    AF1-236          391.35        418.46      -27.11    1210.0           1210.0  System Impact, September 2020
    
  • Dry runs: the setup check, extraction, --validate, the evaluation and a question all finished without calling OpenAI. --validate found nothing to compare and downloaded nothing.

  • Review: a fresh independent review of af7b223 and 24d1d8a found no blockers. d576e48 fixes its findings, except that a failed download still exits with status 0. These fixes had my review only.

  • Not checked against OpenAI's live API: no cost extracted by the model has been compared yet, because the paid extraction hasn't run.

@aymanazeem
aymanazeem merged commit b5b4171 into main Dec 1, 2026
2 checks passed
@aymanazeem
aymanazeem deleted the feat/compare-costs-with-berkeley-lab branch December 1, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant