Contributing to PyPIELM¶
Thank you for your interest in contributing!
Development Setup¶
git clone https://github.com/kstruniawski/pypielm.git
cd pypielm
pip install -e ".[dev]"
Running the Test Suite¶
pytest tests/ -q
With coverage report:
pytest tests/ --cov=pypielm --cov-report=term-missing
Code Style¶
Ruff for linting and import sorting:
ruff check pypielm/Mypy for type checking:
mypy pypielm/Docstrings: Google style — include
Args:,Returns:,Raises:, and anExample::block for every public function.
Pre-commit hooks are configured in .pre-commit-config.yaml (if present).
Adding a New Model¶
Create your class in the appropriate module (e.g.,
pypielm/models/vanilla.py).Inherit from
BasePIELMand implementfit,predict,score, andget_feature_matrix.Decorate the class with
@register("my_model_name")frompypielm.models.registry.Add at least one accuracy test in
tests/solving the 1D Poisson problem with relative L² < 1e-2.Export the class in
pypielm/models/__init__.py.
Commit Convention¶
feat(step-N): short description
fix: short description
docs: short description
test: short description
refactor: short description
Submitting a Pull Request¶
Fork the repository and create a branch:
git checkout -b feat/my-feature.Make your changes and ensure all tests pass.
Push and open a PR against
main.The CI pipeline will run lint, test, and docs checks automatically.