diff --git a/FINDINGS.md b/FINDINGS.md index c0bb35b..37a17fe 100644 --- a/FINDINGS.md +++ b/FINDINGS.md @@ -246,11 +246,12 @@ on the standard deviation), and the region explains 23.3% of utility-level variance against 42.0% under random labels, so utilities do differ, by roughly a quarter of what the raw numbers suggest. -**Worked example.** PPL Electric Utilities carries 98 study groups and 349 -projects in this population, with survivors exposed to 1.80x and 60.5% of scoped -cost stranded under a sunk-cost rule. That is seventh of sixteen PJM utilities -and within 0.03x of the PJM median, which given the null is the honest reading: -indistinguishable from typical. +**Worked example.** The example is picked by rule rather than by result: the +PJM transmission owner with the most study groups, which is AEP. It carries 267 +study groups and 868 projects in this population, with survivors exposed to +1.75x and 60.8% of scoped cost stranded under a sunk-cost rule. That is eleventh +of sixteen PJM utilities and within 0.03x of the PJM median, which given the +null is the honest reading: indistinguishable from typical. **Rests on.** Real transmission owner labels for 89.7% of study groups. Loci where the modal owner holds under half the reported labels are dropped rather diff --git a/README.md b/README.md index e8ac967..2801367 100644 --- a/README.md +++ b/README.md @@ -330,7 +330,7 @@ doubling of assigned cost; queue congestion and exposure alone produce only failures are published, not fixed by re-fitting. - **The claims are guarded.** `tools/check_claims.py` pairs every figure in this file with the results that produce it, fails on drift, requires the caveats to - stay, and rejects overclaiming phrasings. 244 tests cover the rest. + stay, and rejects overclaiming phrasings. 245 tests cover the rest. - **It is checked against what actually happened, and the failures are published.** `results/external_validation.json` scores the mechanisms against 2024-2026 cluster outcomes: three pass and three fail, and the failures bound @@ -384,7 +384,7 @@ results/ one JSON per track plus validation.json, meta.json and run_mode.json, which is what check_claims verifies against figures/ 9 figures data/ queue_source.json (the input pin) and external/evidence.csv -tests/ 244 tests +tests/ 245 tests ``` ## Reproduce @@ -410,11 +410,11 @@ summary statistics. No non-public, internal, confidential or commercially sensitive information appears anywhere in this repository or its history. -That matters most for track 9, which reports exposure by transmission owner and -uses one PJM transmission owner as its worked example. Those figures are derived -entirely from the public LBNL queue, and given that track's own finding, that -utility's number is statistically indistinguishable from the median of its -peers. +Track 9 reports exposure by transmission owner. Its worked example is picked by +rule, not by result: the PJM owner with the most study groups (AEP). Those +figures are derived entirely from the public LBNL queue, and given that track's +own finding, that utility's number is statistically indistinguishable from the +median of its peers. ## Data and license diff --git a/figures/fig7_track9_utility.png b/figures/fig7_track9_utility.png index f5a185d..6e81b13 100644 Binary files a/figures/fig7_track9_utility.png and b/figures/fig7_track9_utility.png differ diff --git a/queuetax/shared/plotting.py b/queuetax/shared/plotting.py index 4aa6454..73b5fe8 100644 --- a/queuetax/shared/plotting.py +++ b/queuetax/shared/plotting.py @@ -169,7 +169,9 @@ def fig_track9_utility(payload: dict) -> Path: fig, axes = plt.subplots(1, 2, figsize=(10.5, 4.4), width_ratios=[2, 1]) values = table["weighted_inflation"].to_numpy(float) - colors = [ACCENT if u.upper() == "PPL" else MUTED for u in table["utility"]] + ex = payload.get("worked_example", {}) + colors = [ACCENT if (u, r) == (ex.get("utility"), ex.get("region")) else MUTED + for u, r in zip(table["utility"], table["region"])] axes[0].bar(range(len(values)), values, color=colors, width=0.9) axes[0].axhline(np.median(values), color=SECOND, linewidth=1.2, linestyle="--", label="median utility") diff --git a/queuetax/tracks/track9_utility.py b/queuetax/tracks/track9_utility.py index 4bec2ef..fb1b06f 100644 --- a/queuetax/tracks/track9_utility.py +++ b/queuetax/tracks/track9_utility.py @@ -208,9 +208,25 @@ def compare_to_regional_spread(table: pd.DataFrame, regional_table: pd.DataFrame return out -def worked_example(table: pd.DataFrame, utility: str = "PPL") -> dict: - """One utility's own exposure, in the terms its interconnection team uses.""" - match = table[table["utility"].str.upper() == utility.upper()] +def example_utility(table: pd.DataFrame, region: str = "PJM") -> str: + """The worked example is picked by a fixed rule, not by its result: the + transmission owner with the most study groups in the region, which is also + the one whose number rests on the most data.""" + block = table[table["region"] == region] + return str(block.sort_values(["n_groups", "utility"], ascending=[False, True]) + .iloc[0]["utility"]) + + +def worked_example(table: pd.DataFrame, utility: str | None = None, + region: str = "PJM") -> dict: + """One utility's own exposure, in the terms its interconnection team uses. + + Matched on region as well as name: some owners (AEP, for one) report + in more than one region, and each region is a separate row.""" + if utility is None: + utility = example_utility(table, region) + match = table[(table["utility"].str.upper() == utility.upper()) + & (table["region"] == region)] if match.empty: return {"available": False, "utility": utility} row = match.iloc[0] @@ -255,5 +271,5 @@ def run( "permutation_null": permutation_null(labelled, table, n_permutations=n_permutations), "variance_decomposition": variance_decomposition(table), "versus_regional": compare_to_regional_spread(table, regional_table), - "worked_example_ppl": worked_example(table, "PPL"), + "worked_example": worked_example(table), } diff --git a/results/meta.json b/results/meta.json index 24a3ddd..cc3dbbb 100644 --- a/results/meta.json +++ b/results/meta.json @@ -1,5 +1,5 @@ { - "n_tests": 244, + "n_tests": 245, "n_figures": 9, "n_tracks": 10, "n_result_files": 18 diff --git a/results/track9_utility.json b/results/track9_utility.json index 79323a4..4a9e392 100644 --- a/results/track9_utility.json +++ b/results/track9_utility.json @@ -716,17 +716,17 @@ }, "west_exceeds_cross_region": true }, - "worked_example_ppl": { + "worked_example": { "available": true, - "utility": "PPL", + "utility": "AEP", "region": "PJM", - "n_groups": 98, - "n_projects": 349, - "weighted_inflation": 1.797056618041088, - "stranded_share_of_initial": 0.6050654895933012, - "mean_survivor_mw_share": 0.26230108380551875, + "n_groups": 267, + "n_projects": 868, + "weighted_inflation": 1.7455991108448161, + "stranded_share_of_initial": 0.6081649385146042, + "mean_survivor_mw_share": 0.26231278664580554, "rank_in_region": [ - 7, + 11, 16 ], "region_median_inflation": 1.7736734989380674 diff --git a/tests/test_ingest.py b/tests/test_ingest.py index 2a7456b..b0fc7f1 100644 --- a/tests/test_ingest.py +++ b/tests/test_ingest.py @@ -71,7 +71,7 @@ def test_hybrid_capacity_is_summed_across_mw_columns(): "mw3": [np.nan], "region": ["PJM"], "entity": ["PJM"], - "utility": ["PPL"], + "utility": ["AEP"], "cluster": [None], "service": ["NRIS"], "project_type": ["Generation"], diff --git a/tests/test_track9.py b/tests/test_track9.py index c1181e5..ab0b069 100644 --- a/tests/test_track9.py +++ b/tests/test_track9.py @@ -111,12 +111,22 @@ def test_raw_spread_comparison_would_have_been_misleading(results): def test_worked_example_reports_rank_not_just_a_number(results): """A single utility's exposure means nothing without its position among peers, given how much of the spread is noise.""" - ppl = results["track9_utility"]["worked_example_ppl"] - assert ppl["available"] - assert ppl["region"] == "PJM" - rank, total = ppl["rank_in_region"] + ex = results["track9_utility"]["worked_example"] + assert ex["available"] + assert ex["region"] == "PJM" + rank, total = ex["rank_in_region"] assert 1 <= rank <= total - assert abs(ppl["weighted_inflation"] - ppl["region_median_inflation"]) < 0.2 + assert abs(ex["weighted_inflation"] - ex["region_median_inflation"]) < 0.2 + + +def test_worked_example_is_picked_by_rule_not_by_result(results): + """The example must be the PJM owner with the most study groups, so nobody + can choose a utility because its number tells a convenient story.""" + payload = results["track9_utility"] + pjm = [r for r in payload["table"] if r["region"] == "PJM"] + largest = max(pjm, key=lambda r: r["n_groups"]) + assert payload["worked_example"]["utility"] == largest["utility"] + assert payload["worked_example"]["n_groups"] == largest["n_groups"] def test_variance_decomposition_sums_to_one(results): diff --git a/tools/check_claims.py b/tools/check_claims.py index 749ef27..8d33f39 100644 --- a/tools/check_claims.py +++ b/tools/check_claims.py @@ -214,8 +214,11 @@ def d(*path, source): Claim("t9_null_between", r"against ([\d.]+)% under random labels", lambda: d("permutation_null", "null_between_region_share_mean", source=t9) * 100, pct, 0.05), - Claim("t9_ppl", r"survivors exposed to ([\d.]+)x", - lambda: d("worked_example_ppl", "weighted_inflation", source=t9), mult, 0.01), + Claim("t9_example", r"survivors exposed to ([\d.]+)x", + lambda: d("worked_example", "weighted_inflation", source=t9), mult, 0.01), + Claim("t9_example_stranded", r"1\.\d+x and ([\d.]+)% of scoped cost stranded", + lambda: d("worked_example", "stranded_share_of_initial", source=t9) * 100, + pct, 0.05), Claim("t10_coverage", r"come to ([\d.]+)% of the cost shifted", lambda: d("headline", "coverage_ratio", source=t10) * 100, pct, 0.05), # Two phrasings, each anchored so it cannot capture a neighbouring bound: