Contributing to phonometry #
Thank you for your interest in contributing to phonometry! We welcome contributions from the community to help improve this project.
🛠️ Development Setup #
To set up your development environment:
-
Clone the repository:
git clone https://github.com/jmrplens/phonometry.git cd phonometry -
Create a virtual environment:
python3 -m venv .venv source .venv/bin/activate # On Windows use: .venv\Scripts\activate -
Install dependencies: Install both production and development dependencies to run tests and linters.
pip install -r requirements.txt pip install -r requirements-dev.txt
✅ Code Quality Standards #
We enforce strict code quality standards. Before submitting a Pull Request, please ensure your code passes the following checks:
1. Type Checking (MyPy) #
We use strict type checking. Ensure no errors are reported:
mypy .
2. Linting & Formatting (Ruff) #
We use ruff for fast linting and formatting.
ruff check .
3. Testing (Pytest) #
Run the full test suite to ensure no regressions. We aim for 100% code coverage.
pytest tests/
To check coverage locally:
pytest --cov=src/phonometry --cov-report=term-missing tests/
4. Documentation Images (auto-generated) #
Every image under .github/images/ is generated with the library itself by
generate_graphs.py — never hand-made. If your change alters filter responses,
weighting curves or any other plotted behavior, regenerate the graphs and commit
the affected images together with the code change:
make graphs # or: python generate_graphs.py
When adding a feature with visual output, add a generate_* function to
generate_graphs.py and reference the resulting image from the docs — do not
commit images produced any other way.
📦 Releasing #
Releases are fully automated from the repository-root VERSION file:
- Open a PR that bumps
VERSION(semver) and moves the[Unreleased]CHANGELOG section to the new version. - When the PR merges to
main, the release workflow validates the version, builds the package, publishes to PyPI and creates the GitHub Release (tag included). Zenodo registers the DOI from the release webhook.
Never push tags manually; the workflow is idempotent (an existing tag is skipped).
🚀 How to Contribute #
Reporting Bugs #
If you find a bug, check the Issues. If not reported, open a new issue with:
- Steps to reproduce
- Expected vs Actual behavior
- Environment details (OS, Python version)
Pull Requests #
- Fork the repository.
- Create a branch for your feature (
git checkout -b feature/amazing-feature). - Commit your changes with clear messages.
- Verify your code using the commands above (
pytest,mypy,ruff). - Push to your fork and Open a Pull Request.
License #
By contributing to this project, you agree that your contributions will be licensed under the project's LICENSE file.