Skip to content

Commit 687a615

Browse files
igerberclaude
andcommitted
Clarify continuous-path mass-point-guard test docstring
Rename test_d_lower_contract_is_mass_point_only -> test_mass_point_equality_guard_does_not_fire_on_continuous and rewrite the docstring so it accurately describes what's exercised. Previously claimed "arbitrary d_lower" but only tests d_lower=d.min(); the renamed test now narrates that the mass-point-specific ValueError does not fire on the continuous path (the continuous path has its own upstream negative-dose guard after the regressor shift). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 77b3466 commit 687a615

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

tests/test_had.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,11 +1087,16 @@ def test_d_lower_within_tolerance_succeeds(self):
10871087
r = est.fit(panel, "outcome", "dose", "period", "unit")
10881088
assert np.isfinite(r.att)
10891089

1090-
def test_d_lower_contract_is_mass_point_only(self):
1091-
"""continuous_near_d_lower accepts arbitrary d_lower (within other guards)."""
1090+
def test_mass_point_equality_guard_does_not_fire_on_continuous(self):
1091+
"""The mass-point-specific d_lower equality guard is not enforced on
1092+
continuous_near_d_lower. (The continuous path has its own upstream
1093+
Phase 1c guards against off-support d_lower via the negative-dose
1094+
check after the regressor shift, but the mass-point-specific
1095+
ValueError does not fire here.)
1096+
"""
10921097
d, dy = _dgp_continuous_near_d_lower(500, seed=0)
10931098
panel = _make_panel(d, dy)
1094-
# Setting d_lower=d.min() on continuous should just work.
1099+
# d_lower == d.min() is always a valid continuous configuration.
10951100
est = HeterogeneousAdoptionDiD(design="continuous_near_d_lower", d_lower=float(d.min()))
10961101
r = est.fit(panel, "outcome", "dose", "period", "unit")
10971102
assert np.isfinite(r.att)

0 commit comments

Comments
 (0)