Skip to content

Commit 1248c44

Browse files
igerberclaude
andcommitted
spillover-tva: address CI codex R2 P3 — pin delta_1 identity in d_bar≥100 grid
CI codex R2 noted the §4 narrative claim that `d_bar in {100, 150, 200}` produces identical estimates covers BOTH `tau_total` AND `delta_1`, but the exact-identity drift guard `test_rings_grid_d_bar_100_to_200_identical` only pinned `tau_total`. `delta_1` was checked via the round-to-1 grid endpoints (`test_rings_sensitivity_grid_endpoints`), which would still pass if a future change introduced a small (<0.05) delta_1 drift between the three d_bar values while keeping the rounded endpoints unchanged. Adds companion test `test_rings_grid_d_bar_100_to_200_identical_delta_1` that asserts `delta_1` is bit-equal (atol=1e-10) across d_bar ∈ {100, 150, 200} on the locked panel, mirroring the tau_total identity test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 00d72e2 commit 1248c44

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/test_t23_spillover_tva_drift.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,24 @@ def test_rings_sensitivity_grid_endpoints(panel):
284284
)
285285

286286

287+
def test_rings_grid_d_bar_100_to_200_identical_delta_1(panel):
288+
"""§4 narrative claim covers BOTH coefficients: `d_bar in {100, 150,
289+
200}` produces identical tau_total AND delta_1 (the test of
290+
tau_total identity lives in `test_rings_grid_d_bar_100_to_200_identical`;
291+
this companion test pins the delta_1 identity so a future drift
292+
that affects only the spillover coefficient can't leave the
293+
'identical' notebook claim stale)."""
294+
deltas = []
295+
for outer in (100.0, 150.0, 200.0):
296+
est = SpilloverDiD(rings=[0.0, outer], conley_coords=("lat", "lon"))
297+
with warnings.catch_warnings():
298+
_silence_spillover_matmul_warnings()
299+
res = est.fit(panel, outcome="y", unit="unit", time="time", treatment="D")
300+
assert res.spillover_effects is not None
301+
deltas.append(float(res.spillover_effects.iloc[0]["coef"]))
302+
np.testing.assert_allclose(deltas, deltas[0] * np.ones(3), atol=1e-10)
303+
304+
287305
def test_rings_grid_d_bar_100_to_200_identical(panel):
288306
"""§4 narrative claim: once d_bar covers the true spillover horizon
289307
(which here ends at ~78 km), widening past 100 km adds zero

0 commit comments

Comments
 (0)