Skip to content

Commit 3ba7f6d

Browse files
igerberclaude
andcommitted
Address PR #371 AI review R3: docstring access-pattern accuracy
P3 fix: `_collect_path_placebo_bootstrap_inputs` docstring described the analytical-results shape as `path_placebos[path]["horizons"][-lag_l]["effect"]` but the actual access is `path_placebos[path][-lag_l]["effect"]` (no `["horizons"]` wrapper -- `_compute_path_placebos` returns the negative-keyed inner dict directly, intentionally diverging from `_compute_path_effects`'s `["horizons"]` nesting). Update the docstring to match the actual access pattern at the implementation site (`:5818-5824`). Harmless at runtime; the fix is to prevent the comment from misleading future maintenance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f70c17f commit 3ba7f6d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

diff_diff/chaisemartin_dhaultfoeuille.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5734,9 +5734,12 @@ def _collect_path_placebo_bootstrap_inputs(
57345734
``path_placebo_event_study[path][-lag_l]`` post-bootstrap.
57355735
57365736
The point estimate per ``(path, lag_l)`` is read from
5737-
``path_placebos[path]["horizons"][-lag_l]["effect"]`` to stay
5738-
bit-identical with the analytical pass; the bootstrap distribution
5739-
gets centered on this value by ``_bootstrap_one_target`` downstream.
5737+
``path_placebos[path][-lag_l]["effect"]`` (note: no ``["horizons"]``
5738+
wrapper -- ``_compute_path_placebos`` returns the negative-keyed
5739+
inner dict directly, unlike ``_compute_path_effects`` which wraps
5740+
its horizons under a ``["horizons"]`` key) to stay bit-identical
5741+
with the analytical pass; the bootstrap distribution gets centered
5742+
on this value by ``_bootstrap_one_target`` downstream.
57405743
57415744
The ``warnings.catch_warnings`` block suppresses the
57425745
re-enumeration overflow ``UserWarning``; the analytical

0 commit comments

Comments
 (0)