## Overview Once the py-statmatch package is ready, we should replace all R/rpy2 dependencies with the pure Python implementation. ## py-statmatch Repository https://github.com/PolicyEngine/py-statmatch ## Benefits 1. **No R installation required** - Simplifies setup and CI/CD 2. **Better cross-platform compatibility** - Works on all platforms without R 3. **Easier maintenance** - Pure Python is easier to debug and maintain 4. **Faster CI builds** - No need to install R and its dependencies 5. **Resolves documentation build issues** - Fixes #92 ## Tasks - [ ] Complete py-statmatch implementation with full test coverage - [ ] Publish py-statmatch to PyPI - [ ] Replace `microimpute.utils.statmatch_hotdeck` with py-statmatch - [ ] Remove `microimpute.utils.statmatch_python` (temporary implementation) - [ ] Update all imports from `rpy2` to py-statmatch - [ ] Remove rpy2 from optional dependencies in `pyproject.toml` - [ ] Update documentation notebooks to use py-statmatch - [ ] Update README and documentation ## Code changes needed 1. In `microimpute/models/matching.py`: - Replace R imports with `from statmatch import nnd_hotdeck` 2. Remove these files: - `microimpute/utils/statmatch_hotdeck.py` - `microimpute/utils/statmatch_python.py` - `microimpute/utils/import_helpers.py` 3. Update `pyproject.toml`: - Remove `matching` optional dependency group - Add `py-statmatch` to main dependencies
Overview
Once the py-statmatch package is ready, we should replace all R/rpy2 dependencies with the pure Python implementation.
py-statmatch Repository
https://github.com/PolicyEngine/py-statmatch
Benefits
Tasks
microimpute.utils.statmatch_hotdeckwith py-statmatchmicroimpute.utils.statmatch_python(temporary implementation)rpy2to py-statmatchpyproject.tomlCode changes needed
In
microimpute/models/matching.py:from statmatch import nnd_hotdeckRemove these files:
microimpute/utils/statmatch_hotdeck.pymicroimpute/utils/statmatch_python.pymicroimpute/utils/import_helpers.pyUpdate
pyproject.toml:matchingoptional dependency grouppy-statmatchto main dependencies