Skip to content

Commit bed7fbe

Browse files
authored
Merge pull request #410 from igerber/docs/sphinx-member-duplicate-fix
docs: custom autosummary template + residual triage (PR 2.5)
2 parents 6a1e5b2 + e25445e commit bed7fbe

132 files changed

Lines changed: 1152 additions & 671 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

TODO.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,8 @@ Deferred items from PR reviews that were not addressed before merge.
131131
|-------|----------|----|----------|
132132
| R comparison tests spawn separate `Rscript` per test (slow CI) | `tests/test_methodology_twfe.py:294` | #139 | Low |
133133
| CS R helpers hard-code `xformla = ~ 1`; no covariate-adjusted R benchmark for IRLS path | `tests/test_methodology_callaway.py` | #202 | Low |
134-
| ~1583 `duplicate object description` Sphinx warnings — restructure `docs/api/*.rst` to avoid duplicate `:members:` + `autosummary` (count grew from ~376 as API surface expanded) | `docs/api/*.rst` || Low |
135134
| Doc-snippet smoke tests only cover `.rst` files; `.txt` AI guides outside CI validation | `tests/test_doc_snippets.py` | #239 | Low |
136135
| Add CI validation for `docs/doc-deps.yaml` integrity (stale paths, unmapped source files) | `docs/doc-deps.yaml` | #269 | Low |
137-
| Sphinx autodoc fails to import 3 result members: `DiDResults.ci`, `MultiPeriodDiDResults.att`, `CallawaySantAnnaResults.aggregate` — investigate whether these are renamed/removed or just unresolvable from autosummary template | `docs/api/results.rst`, `docs/api/staggered.rst` || Medium |
138-
| `EDiDBootstrapResults` cross-reference is ambiguous — class is exported from both `diff_diff` and `diff_diff.efficient_did_bootstrap`, producing 3 "more than one target found" warnings. Add `:noindex:` to one source or use full-path refs | `diff_diff/efficient_did_results.py`, `docs/api/efficient_did.rst` || Low |
139-
| Tracked Sphinx autosummary stubs in `docs/api/_autosummary/*.rst` are stale — every sphinx build regenerates them with new attributes (e.g., `coef_var`, `survey_metadata`) that have been added to result classes. Either commit a refresh or move the directory to `.gitignore` and treat as build output. Also 6 untracked stubs exist for newer estimators (`WooldridgeDiD`, `SimulationMDEResults`, etc.) that have never been committed. | `docs/api/_autosummary/` || Low |
140136
| HonestDiD `test_m0_short_circuit` uses wall-clock `elapsed < 0.5s` as a proxy for "short-circuit path taken" instead of calling the full optimizer. Replace with a direct correctness signal (mock/spy the optimizer or check a state flag) so the test doesn't depend on CI timing. Not flaky today at 500ms, but load-bearing correctness on a timing proxy is brittle. | `tests/test_methodology_honest_did.py:246` || Low |
141137
| SyntheticDiD: rename internal `placebo_effects` variable to `variance_effects` (or `resampled_effects`). Misleading name across the placebo/bootstrap/jackknife dispatch paths — holds three different contents depending on variance method. Low-risk refactor; user-facing field rename should preserve `placebo_effects` as a deprecated alias for one release. | `synthetic_did.py`, `results.py` | follow-up | Medium |
142138

diff_diff/results.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,7 @@ def in_time_placebo(
12751275
- ``pre_fit_rmse`` — RMSE on the fake pre-window
12761276
- ``n_pre_fake`` — periods before the fake date
12771277
- ``n_post_fake`` — periods from the fake date onward
1278+
12781279
NaN is emitted only for dimensional infeasibility. Frank-Wolfe
12791280
does not expose a mid-solver non-convergence signal; inspect
12801281
``pre_fit_rmse`` for poor refit quality.

diff_diff/triple_diff.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,13 @@ class TripleDifference:
355355
356356
Estimates the Average Treatment effect on the Treated (ATT) when treatment
357357
requires satisfying two criteria: belonging to a treated group AND being
358-
in an eligible partition of the population.
358+
in an eligible partition of the population. The DDD design was popularized
359+
by Gruber (1994) [2]_.
359360
360-
This implementation follows Ortiz-Villavicencio & Sant'Anna (2025), which
361-
shows that naive DDD implementations (difference of two DiDs, three-way
362-
fixed effects) are invalid when covariates are needed for identification.
361+
This implementation follows Ortiz-Villavicencio & Sant'Anna (2025) [1]_,
362+
which shows that naive DDD implementations (difference of two DiDs,
363+
three-way fixed effects) are invalid when covariates are needed for
364+
identification.
363365
364366
Parameters
365367
----------
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{ fullname | escape | underline }}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autoclass:: {{ objname }}
6+
:no-members:
7+
{% block methods %}
8+
{% if methods %}
9+
.. rubric:: {{ _('Methods') }}
10+
11+
.. autosummary::
12+
{% for item in methods %}
13+
~{{ name }}.{{ item }}
14+
{%- endfor %}
15+
{% endif %}
16+
{% endblock %}
17+
{% block attributes %}
18+
{% if attributes %}
19+
.. rubric:: {{ _('Attributes') }}
20+
21+
.. autosummary::
22+
{% for item in attributes %}
23+
~{{ name }}.{{ item }}
24+
{%- endfor %}
25+
{% endif %}
26+
{% endblock %}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autofunction:: {{ objname }}
6+
:no-index:

docs/api/_autosummary/diff_diff.BaconDecomposition.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,20 @@
44
.. currentmodule:: diff_diff
55

66
.. autoclass:: BaconDecomposition
7+
:no-members:
78

8-
9-
.. automethod:: __init__
109

11-
1210
.. rubric:: Methods
1311

1412
.. autosummary::
15-
13+
1614
~BaconDecomposition.__init__
1715
~BaconDecomposition.fit
1816
~BaconDecomposition.get_params
1917
~BaconDecomposition.print_summary
2018
~BaconDecomposition.set_params
2119
~BaconDecomposition.summary
22-
23-
2420

25-
26-
27-
21+
22+
23+

docs/api/_autosummary/diff_diff.BaconDecompositionResults.rst

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,30 @@
44
.. currentmodule:: diff_diff
55

66
.. autoclass:: BaconDecompositionResults
7+
:no-members:
78

8-
9-
.. automethod:: __init__
109

11-
1210
.. rubric:: Methods
1311

1412
.. autosummary::
15-
13+
1614
~BaconDecompositionResults.__init__
1715
~BaconDecompositionResults.effect_by_type
1816
~BaconDecompositionResults.print_summary
1917
~BaconDecompositionResults.summary
2018
~BaconDecompositionResults.to_dataframe
2119
~BaconDecompositionResults.weight_by_type
22-
23-
2420

25-
26-
21+
22+
23+
2724
.. rubric:: Attributes
2825

2926
.. autosummary::
30-
27+
3128
~BaconDecompositionResults.decomposition_error
3229
~BaconDecompositionResults.n_obs
30+
~BaconDecompositionResults.survey_metadata
3331
~BaconDecompositionResults.twfe_estimate
3432
~BaconDecompositionResults.comparisons
3533
~BaconDecompositionResults.total_weight_treated_vs_never
@@ -41,5 +39,4 @@
4139
~BaconDecompositionResults.n_timing_groups
4240
~BaconDecompositionResults.n_never_treated
4341
~BaconDecompositionResults.timing_groups
44-
45-
42+

docs/api/_autosummary/diff_diff.CSBootstrapResults.rst

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,22 @@
44
.. currentmodule:: diff_diff
55

66
.. autoclass:: CSBootstrapResults
7+
:no-members:
78

8-
9-
.. automethod:: __init__
109

11-
1210
.. rubric:: Methods
1311

1412
.. autosummary::
15-
13+
1614
~CSBootstrapResults.__init__
17-
18-
1915

20-
21-
16+
17+
18+
2219
.. rubric:: Attributes
2320

2421
.. autosummary::
25-
22+
2623
~CSBootstrapResults.bootstrap_distribution
2724
~CSBootstrapResults.cband_crit_value
2825
~CSBootstrapResults.event_study_cis
@@ -40,5 +37,4 @@
4037
~CSBootstrapResults.group_time_ses
4138
~CSBootstrapResults.group_time_cis
4239
~CSBootstrapResults.group_time_p_values
43-
44-
40+

docs/api/_autosummary/diff_diff.CallawaySantAnna.rst

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,32 @@
44
.. currentmodule:: diff_diff
55

66
.. autoclass:: CallawaySantAnna
7+
:no-members:
78

8-
9-
.. automethod:: __init__
109

11-
1210
.. rubric:: Methods
1311

1412
.. autosummary::
15-
13+
1614
~CallawaySantAnna.__init__
15+
~CallawaySantAnna.diagnose_propensity
1716
~CallawaySantAnna.fit
1817
~CallawaySantAnna.get_params
1918
~CallawaySantAnna.print_summary
2019
~CallawaySantAnna.set_params
2120
~CallawaySantAnna.summary
22-
23-
2421

25-
26-
22+
23+
24+
2725
.. rubric:: Attributes
2826

2927
.. autosummary::
30-
28+
3129
~CallawaySantAnna.n_bootstrap
3230
~CallawaySantAnna.bootstrap_weights
3331
~CallawaySantAnna.alpha
3432
~CallawaySantAnna.seed
3533
~CallawaySantAnna.anticipation
3634
~CallawaySantAnna.base_period
37-
38-
35+

docs/api/_autosummary/diff_diff.CallawaySantAnnaResults.rst

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,51 @@
44
.. currentmodule:: diff_diff
55

66
.. autoclass:: CallawaySantAnnaResults
7+
:no-members:
78

8-
9-
.. automethod:: __init__
109

11-
1210
.. rubric:: Methods
1311

1412
.. autosummary::
15-
13+
1614
~CallawaySantAnnaResults.__init__
15+
~CallawaySantAnnaResults.epv_summary
1716
~CallawaySantAnnaResults.print_summary
1817
~CallawaySantAnnaResults.summary
1918
~CallawaySantAnnaResults.to_dataframe
20-
21-
2219

23-
24-
20+
21+
22+
2523
.. rubric:: Attributes
2624

2725
.. autosummary::
28-
26+
2927
~CallawaySantAnnaResults.alpha
28+
~CallawaySantAnnaResults.anticipation
29+
~CallawaySantAnnaResults.att
3030
~CallawaySantAnnaResults.base_period
3131
~CallawaySantAnnaResults.bootstrap_results
3232
~CallawaySantAnnaResults.cband_crit_value
33+
~CallawaySantAnnaResults.coef_var
34+
~CallawaySantAnnaResults.conf_int
3335
~CallawaySantAnnaResults.control_group
36+
~CallawaySantAnnaResults.epv_diagnostics
37+
~CallawaySantAnnaResults.epv_threshold
3438
~CallawaySantAnnaResults.event_study_effects
39+
~CallawaySantAnnaResults.event_study_vcov
40+
~CallawaySantAnnaResults.event_study_vcov_index
3541
~CallawaySantAnnaResults.group_effects
3642
~CallawaySantAnnaResults.influence_functions
3743
~CallawaySantAnnaResults.is_significant
44+
~CallawaySantAnnaResults.p_value
45+
~CallawaySantAnnaResults.panel
46+
~CallawaySantAnnaResults.pscore_fallback
3847
~CallawaySantAnnaResults.pscore_trim
48+
~CallawaySantAnnaResults.se
3949
~CallawaySantAnnaResults.significance_stars
50+
~CallawaySantAnnaResults.survey_metadata
51+
~CallawaySantAnnaResults.t_stat
4052
~CallawaySantAnnaResults.group_time_effects
4153
~CallawaySantAnnaResults.overall_att
4254
~CallawaySantAnnaResults.overall_se
@@ -48,5 +60,4 @@
4860
~CallawaySantAnnaResults.n_obs
4961
~CallawaySantAnnaResults.n_treated_units
5062
~CallawaySantAnnaResults.n_control_units
51-
52-
63+

0 commit comments

Comments
 (0)