Repository navigation
Count queue age until a project leaves the queue, and add four fuel types - #9
Merged
Merged
Conversation
…ypes queue_age_days counted every project to the day the panel was built, so a project that withdrew years ago kept ageing, and every age moved with the build date. The panel also put Berkeley Lab's coal, nuclear, oil and diesel projects in "other", so the agent couldn't answer a question about them. - Queue age now runs from the request to the day a project withdrew or began operating. For a project still in the queue it runs to the date the data runs to: 31 December 2025 for the pinned workbook (lbnl_data_end in src/config.py, from its sheet 02), or the day the live queue is pulled. It is null when that end is unknown or before the request date. - The panel keeps withdrawn_date and operational_date, from Berkeley Lab's wd_date and on_date, or gridstatus's Withdrawn Date and Actual Completion Date. - fuel_type gains coal, nuclear, oil and diesel. - The query tool's description, the README, docs/decisions.md and docs/future_work.md follow. Rebuilt from the pinned workbook: 7,666 projects, statuses unchanged. Other falls from 631 to 339, as 138 coal, 77 nuclear, 53 oil and 24 diesel projects get their own types. 146 projects have no queue age, up from 48: 86 withdrawn with no withdrawal date, 48 with no request date, 7 operating with no operating date, 5 ending before their request. The median age of withdrawn projects falls from 8.7 years to 2.0, of operating ones from 15.3 to 3.1, and of active and suspended ones by about 11 months. make test passes offline, with five new tests. The new queue age and fuel tests fail on the previous code.
…ueue's dates The query tool's description said withdrawn_date and operational_date are null unless a project has withdrawn or is operating. 20 panel rows break that, so an agent counting withdrawals by date would get 5,146 instead of 5,226. It now says to use status for that, and gives the full rule for a blank queue age. - A project whose status the panel doesn't recognise counts to its withdrawal or operating date if it has one, and otherwise to the end of the data. No Berkeley Lab PJM project has such a status, but PJM's live queue can. - A build with --file says which date queue age counts to, and that LBNL_DATA_END sets another. - New tests use gridstatus's own column names for the live queue, cover an unrecognised status and an operating project with no operating date, and check that the tool description lists every column, status and fuel type. Six planted bugs each fail a test. - docs/decisions.md gives the fuel-type decision its alternatives and evidence, and notes the 12 withdrawal dates in January 2026. The README explains hybrids. Rebuilt from the pinned workbook: the README's counts are unchanged, including the 146 projects with no queue age.
- A live-queue build given --file no longer prints the note about LBNL_DATA_END, which only applies to Berkeley Lab's workbook. - The query tool's description says the live queue counts to the day it is downloaded. - The test workbook spells out Berkeley Lab's column names, and a test checks that a named workbook keeps its withdrawal and operating dates. - New tests: a project that leaves the queue the day it applied has an age of 0, and an unrecognised status with both dates ends at its withdrawal date. - The README's queue age wording is clearer, and docs/decisions.md gives the measured medians. 178 tests pass offline.
Owner
Author
Review and test evidenceHead commit Review. A separate agent reviewed the first commit, and Tests.
CI. Every run used GitHub's standard
Not checked against OpenAI's live API. No OpenAI call was made, and nothing was spent. I haven't seen the real agent read the new tool description, so I haven't confirmed that it uses |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
queue_age_dayscounted every project to the day the panel was built. A project that withdrew years ago kept ageing, and every age moved with the build date.What changes
lbnl_data_endinsrc/config.py), or the day the live queue is pulled.withdrawn_dateandoperational_date, from Berkeley Lab'swd_dateandon_date, or gridstatus'sWithdrawn DateandActual Completion Date.fuel_typegains coal, nuclear, oil and diesel.status, not the dates, to tell whether a project withdrew or is operating. 20 panel rows have a date their status contradicts, so counting withdrawals by date gives 5,146, not 5,226.--file) says which date queue age counts to, and thatLBNL_DATA_ENDsets another.docs/decisions.mdrecords both decisions with alternatives and evidence, anddocs/future_work.mddrops the two items.Results, rebuilt from the pinned workbook
The panel still has 7,666 projects with the same status counts. Other falls from 631 to 339, as 138 coal, 77 nuclear, 53 oil and 24 diesel projects get their own types.
146 projects have no queue age, up from 48:
The median ages fall:
Verification
make test: 178 passed offline, with the currentmainmerged in.othercounted to the data end;--filenote dropped;wd_datemisspelt in the workbook column map;--filenote printed for a live-queue build.docs/decisions.mdagainst it.Review
An independent agent reviewed the first commit. It found no bugs in the SQL or the parsing, and confirmed the counts against the workbook. The second commit fixes its findings:
--filewith another release gave no warning.A second independent review, of the branch with
mainmerged in, approved it with points the third commit fixes:--filenote also printed for a live-queue build, where the workbook's date doesn't apply.docs/decisions.mdin place of a made-up example.Not checked against OpenAI's live API
No OpenAI call was made. The tests check the tool description's text, but I haven't seen the real agent read it, so I haven't confirmed that it uses
statusrather than the dates, or that it handles the new fuel types. The paid evaluation runs once credits are available.