Commit 6d6e950
Address PR #402 R1 review (1 P1, 4 P2)
P1 methodology fix: Step-4 routing in _handle_had + _handle_had_event_study
no longer says "switch away from HAD if untreated units exist" - that
contradicts REGISTRY § HeterogeneousAdoptionDiD edge cases (line 2403:
"Authors do NOT require untreated units to be dropped"; line 2408 +
had.py:1325: never-treated units RETAINED on staggered event-study).
Reframed as the actual estimand differentiator: HAD targets WAS at the
dose support boundary; ContinuousDiD targets per-dose ATT(d) / ACRT(d)
and requires never-treated controls. Routing fires only when the user
wants the ATT(d) estimand AND has never-treated controls, not on
"untreated units exist". Tightens the corresponding Choosing-an-Estimator
table row to surface WAS vs ATT(d) as the differentiator.
P2 (a) signatures: llms-full.txt HAD constructor + fit() blocks now
match the actual HeterogeneousAdoptionDiD.__init__ / .fit signatures
exactly. Drops invented kwargs (h, b, rcond) and adds the real ones
(d_lower, kernel, vcov_type, robust, cluster). aggregate default
corrected from None to "overall". fit() now lists survey, weights,
cband (positional-or-keyword) and survey_design + trends_lin
(keyword-only).
P2 (b) snippet bugs: result.bandwidth_diagnostics -> results.bandwidth_diagnostics
(matching the plural convention of other handlers); sup-t snippet now
imports SurveyDesign and constructs sd before passing
survey_design=sd (was survey_design=design with no design defined).
P2 (c) tests: New TestLLMsFullHADCoverage tests use
inspect.signature(HeterogeneousAdoptionDiD.__init__) and .fit() to
regress the documented signatures against the real API. New
test_llms_full_had_section_methodology_compatible_with_untreated locks
the negative assertion that the section does NOT carry framing
contradicting the registry. Practitioner tests gain
test_had_step_4_does_not_misframe_untreated_unit_routing +
test_had_handler_snippets_are_valid_python_syntax (catches snippet
syntax errors via ast.parse) +
test_handle_continuous_step_4_snippet_is_valid_python.
83 tests pass (47 in test_practitioner including 5 new + 36 in
test_guides including 9 new).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d152b50 commit 6d6e950
5 files changed
Lines changed: 237 additions & 72 deletions
File tree
- diff_diff
- guides
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
595 | | - | |
| 595 | + | |
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
599 | | - | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
600 | 602 | | |
601 | | - | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
602 | 607 | | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | 608 | | |
607 | 609 | | |
608 | 610 | | |
| |||
614 | 616 | | |
615 | 617 | | |
616 | 618 | | |
617 | | - | |
618 | | - | |
619 | 619 | | |
| 620 | + | |
| 621 | + | |
620 | 622 | | |
621 | | - | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
622 | 626 | | |
623 | | - | |
624 | | - | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
625 | 630 | | |
626 | 631 | | |
627 | 632 | | |
| |||
636 | 641 | | |
637 | 642 | | |
638 | 643 | | |
639 | | - | |
| 644 | + | |
640 | 645 | | |
641 | 646 | | |
642 | 647 | | |
| |||
1887 | 1892 | | |
1888 | 1893 | | |
1889 | 1894 | | |
1890 | | - | |
1891 | | - | |
| 1895 | + | |
| 1896 | + | |
1892 | 1897 | | |
1893 | 1898 | | |
1894 | 1899 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
879 | | - | |
| 879 | + | |
880 | 880 | | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
888 | 893 | | |
889 | 894 | | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
901 | 904 | | |
902 | 905 | | |
903 | 906 | | |
| |||
910 | 913 | | |
911 | 914 | | |
912 | 915 | | |
913 | | - | |
| 916 | + | |
914 | 917 | | |
915 | 918 | | |
916 | 919 | | |
917 | 920 | | |
918 | | - | |
919 | | - | |
| 921 | + | |
920 | 922 | | |
921 | 923 | | |
922 | 924 | | |
| |||
1005 | 1007 | | |
1006 | 1008 | | |
1007 | 1009 | | |
1008 | | - | |
| 1010 | + | |
1009 | 1011 | | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
1015 | 1022 | | |
1016 | 1023 | | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
1025 | 1033 | | |
1026 | 1034 | | |
1027 | 1035 | | |
| |||
1033 | 1041 | | |
1034 | 1042 | | |
1035 | 1043 | | |
1036 | | - | |
1037 | | - | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
1038 | 1047 | | |
1039 | 1048 | | |
1040 | | - | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
1041 | 1052 | | |
1042 | 1053 | | |
1043 | 1054 | | |
1044 | 1055 | | |
1045 | 1056 | | |
1046 | 1057 | | |
1047 | | - | |
| 1058 | + | |
1048 | 1059 | | |
1049 | 1060 | | |
1050 | 1061 | | |
| |||
0 commit comments