When implementing new functionality, always include accompanying documentation updates.
-
README.md - Add:
- Feature mention in the features list
- Full usage section with code examples
- Parameter documentation table
- API reference section (constructor params, fit() params, results attributes/methods)
- Scholarly references if applicable
-
docs/api/*.rst - Add:
- RST documentation with
autoclassdirectives - Method summaries
- References to academic papers
- RST documentation with
-
docs/tutorials/*.ipynb - Update relevant tutorial or create new one:
- Working code examples
- Explanation of when/why to use the feature
- Comparison with related functionality
-
CLAUDE.md - Update only if adding new critical rules or design patterns
-
ROADMAP.md - Update:
- Move implemented features from planned to current status
- Update version numbers
- Update relevant docstrings
- Add/update tests
- Update CHANGELOG.md (if exists)
- If methodology-related: Update
docs/methodology/REGISTRY.mdedge cases section
For methods based on academic papers, always include:
- Full citation in README.md references section
- Reference in RST docs with paper details
- Citation in tutorial summary
Example format:
Sun, L., & Abraham, S. (2021). Estimating dynamic treatment effects in
event studies with heterogeneous treatment effects. *Journal of Econometrics*,
225(2), 175-199.
- Don't just test that code runs without exception
- Assert the expected behavior actually occurred
- Bad:
result = func(bad_input)(only tests no crash) - Good:
result = func(bad_input); assert np.isnan(result.coef)(tests behavior)
- Test parameter appears in
get_params()output - Test
set_params()modifies the attribute - Test parameter actually affects behavior (not just stored)
- Capture warnings with
warnings.catch_warnings(record=True) - Assert warning message was emitted
- Assert the warned-about behavior occurred
Use assert_nan_inference() from conftest.py to validate ALL inference fields are
NaN-consistent. Don't check individual fields separately.