Commit 0ecb635
Address PR #402 R5 review (1 P3, doc-drift fix)
P3 dataclass-docstring drift: PR #402 R3 fixed the llms-full.txt field
descriptions to acknowledge that weighted mass-point HAD fits populate
variance_formula in {"pweight_2sls", "survey_binder_tsl_2sls"} and
effective_dose_mean as the weighted Wald-IV dose gap (per
had.py:3585-3660), but the HeterogeneousAdoptionDiDResults dataclass
field docstrings in had.py:347-366 still said those fields were
continuous-only / None on mass-point - leaving two source-of-truth
surfaces disagreeing about the same public result object.
Updated both field docstrings to enumerate all four variance_formula
labels (continuous + mass-point variants under both `weights=` shortcut
and `survey_design=` paths) and to describe the mass-point weighted
Wald-IV dose-gap denominator semantics (`mean(D | Z=1, w) -
mean(D | Z=0, w)` where Z = 1{D > d_lower}).
Tests added (1 new, 90 total):
- test_had_results_dataclass_docstrings_match_weighted_mass_point_contract:
uses inspect.getsource(HeterogeneousAdoptionDiDResults) to scan the
class source and assert the variance_formula docstring mentions both
pweight_2sls and survey_binder_tsl_2sls labels, and the
effective_dose_mean docstring mentions mass-point Wald-IV semantics.
Locks both field docstrings against drift back to the
continuous-only framing now that the llms-full.txt guide and the
actual fit() code populate these on mass-point fits.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d4b9091 commit 0ecb635
2 files changed
Lines changed: 73 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
355 | 359 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
367 | 373 | | |
368 | 374 | | |
369 | 375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
693 | 742 | | |
694 | 743 | | |
695 | 744 | | |
| |||
0 commit comments