Contributing to qiskit-waveform-sim¶
We welcome contributions! This guide will help you get started.
Code of Conduct¶
This project follows our Code of Conduct. By participating, you agree to uphold this code.
How to Contribute¶
Reporting Issues¶
Search existing issues first to avoid duplicates
Use the issue templates when available
Provide minimal reproduction steps
Include environment info (Python version, Qiskit version, OS)
Submitting Pull Requests¶
Fork the repository
Create a feature branch:
git checkout -b feature/my-featureMake your changes
Run tests and linters (see below)
Submit a PR with a clear description
Development Setup¶
git clone https://github.com/PratulDeshpande/qiskit-waveform-sim
cd qiskit-waveform-sim
pip install -e ".[dev,test,docs]"
pre-commit install
Running Tests¶
# Run all tests
pytest -v tests/
# Run with coverage (fails below the 88% gate set in pyproject.toml)
pytest tests/ --cov --cov-report=term-missing
# Run an example headless (no browser tabs): matplotlib Agg, Plotly json renderer
PYTHONUTF8=1 MPLBACKEND=Agg PLOTLY_RENDERER=json python examples/visualization_example.py
# Execute the tutorial notebooks (as CI does)
MPLBACKEND=Agg pytest --nbmake docs/source/tutorials -q
# Run specific test file
pytest -v tests/test_core.py
# Run with parallel execution
pytest -n auto tests/
Code Style¶
We use the following tools (configured in pyproject.toml):
Ruff - Fast Python linter
Black - Code formatter
MyPy - Static type checker
Run all checks:
ruff check qiskit_waveform_sim tests examples
black --check qiskit_waveform_sim tests examples
mypy qiskit_waveform_sim
The same checks run on every commit once you pre-commit install
(configured in .pre-commit-config.yaml).
Auto-fix formatting:
ruff check --fix qiskit_waveform_sim tests examples
black qiskit_waveform_sim tests examples
Adding New Features¶
Core Engine: Add new envelope types in
AnalyticalEnvelopesAnnotations: Extend
PulseEnvelopeAnnotationfor new pulse parametersVisualization: Add new Plotly/Matplotlib functions in
visualization/Hardware Export: Add new export functions in examples/
Testing Guidelines¶
Write tests for new functionality in
tests/Use fixtures from
tests/conftest.pyMark slow tests with
@pytest.mark.slowMark integration tests with
@pytest.mark.integration
Documentation¶
Update docstrings for public APIs (NumPy style)
Add examples to relevant tutorial notebooks
Build docs locally:
cd docs && sphinx-build -b html source _build/html -W --keep-going
Release Process¶
Releases are managed by maintainers:
On a branch, bump
versioninpyproject.toml(the package and the docs read it from there) and theversionfield of the README citation, and move the[Unreleased]entries inCHANGELOG.mdunder the new version.Open a pull request and wait for CI to pass.
Merge the pull request. Never amend or force-push
mainafter merging.git pullso your localmainmatchesorigin/main.Tag the merge commit on
origin/main:git tag vX.Y.Z.Push the tag:
git push origin vX.Y.Z.The publish workflow builds and uploads to PyPI.
Create the GitHub release from the tag (do not leave a duplicate draft release).
Getting Help¶
Open a GitHub Discussion for questions
Check existing issues and PRs