Contributing
We welcome contributions to AMBER! This guide will help you get started.
Getting Started
Fork the Repository
Fork the AMBER repository on GitHub and clone your fork:
git clone https://github.com/your-username/AMBER.git cd AMBER
Set Up Development Environment
Create a virtual environment and install development dependencies:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -e ".[dev]"
Run Tests
Make sure all tests pass before making changes:
pytest tests/
Types of Contributions
- Bug Reports
Report bugs using GitHub Issues. Include: - Clear description of the problem - Steps to reproduce - Expected vs actual behavior - System information (OS, Python version, AMBER version)
- Feature Requests
Suggest new features using GitHub Issues. Include: - Clear description of the feature - Use case and motivation - Proposed API (if applicable)
- Code Contributions
Bug fixes
New features
Performance improvements
Documentation improvements
- Documentation
Fix typos and improve clarity
Add examples
Translate documentation
Development Workflow
Create a Branch
git checkout -b feature/your-feature-name
Make Changes
Write code following our style guidelines
Add tests for new functionality
Update documentation as needed
Test Your Changes
# Run all tests pytest tests/ # Run specific test file pytest tests/test_model.py # Run with coverage pytest tests/ --cov=ambr
Commit Changes
git add . git commit -m "Add feature: description of changes"
Push and Create Pull Request
git push origin feature/your-feature-name
Then create a pull request on GitHub.
Code Style Guidelines
- Python Style
Follow PEP 8
Use type hints where appropriate
Write docstrings for all public functions and classes
Use meaningful variable and function names
- Testing
Write tests for all new functionality
Aim for high test coverage
Use descriptive test names
Include both unit and integration tests
- Documentation
Update docstrings for API changes
Add examples for new features
Update tutorials if relevant
Pull Request Guidelines
- Before Submitting
Ensure all tests pass
Update documentation
Add entry to changelog (if applicable)
Rebase on latest main branch
- Pull Request Description
Clear title summarizing the change
Detailed description of what was changed and why
Link to related issues
Screenshots for UI changes (if applicable)
- Review Process
All PRs require review from maintainers
Address feedback promptly
Keep PRs focused and reasonably sized
Be patient - reviews take time
Release Process
AMBER follows semantic versioning:
Major (x.0.0): Breaking changes
Minor (0.x.0): New features, backward compatible
Patch (0.0.x): Bug fixes, backward compatible
Before tagging a release:
Make sure
devis up to date withorigin/devand merged or fast forwarded intomainfor release.Bump the package version in
pyproject.tomland updateCHANGELOG.mdplusdocs/changelog.rst(also keepsrc/ambr/__init__.pyanddocs/conf.pyfallbacks in sync).Run
make release-checkfrom a clean checkout. This builds the wheel and source distribution, runstwine check, and executes the test suite.Inspect the source distribution: only package metadata and
src/ambrshould ship (benchmarks, docs sources, examples stay out of the sdist viaMANIFEST.in; local paper drafts stay untracked via.gitignore— cite the public paper, do not commit drafts).Create and push an annotated
vX.Y.Ztag from the release commit onmain. TheReleaseworkflow (.github/workflows/release.yml):builds and validates the sdist/wheel
attaches them to a GitHub Release
publishes to PyPI via Trusted Publishing (OIDC)
PyPI Trusted Publishing (one-time, preferred)
Do not paste API tokens into chat or commit them. Configure OIDC once:
On PyPI: Publishing settings for ambr
Add a GitHub trusted publisher with:
Owner:
a11to1n3Repository:
AMBERWorkflow name:
release.ymlEnvironment name:
pypi
On GitHub: Environment
pypialready exists on this repo (Settings → Environments). Optional: require reviewers before deploys.
Status (repo side): GitHub Environment pypi is configured; the
Release workflow requests OIDC (id-token: write). You must still
add the matching Trusted Publisher row on PyPI (step 1–2) if the next tag
should upload automatically — that step requires project-owner login on
pypi.org and cannot be done from CI alone.
If Trusted Publishing is not configured yet, you can still upload manually
with a project-scoped token (twine upload) and then switch to OIDC.
Revoke any token that has been exposed.
Lint & type checks
CI runs a dedicated Ruff + mypy job on every PR:
ruff check src/ambr
mypy # module list configured in pyproject.toml [tool.mypy]
make lint / make type-check wrap the same tools for local use.
History rewrite (2026-07)
The repository history was rewritten once to drop large notebook outputs,
paper drafts, and other local-only blobs (.git ~160 MB → ~3 MB on a
fresh clone). If your local clone predates that rewrite:
git fetch origin
git checkout dev
git reset --hard origin/dev
# or re-clone: git clone https://github.com/a11to1n3/AMBER.git
Do not merge old local branches that still contain the pre-rewrite
history without rebasing onto the new origin/dev.
Repo hygiene
Install git hooks once:
pip install -e ".[dev]" && pre-commit install(ormake pre-commit-install). Commits then run nbstripout (strip notebook outputs) and ruff onsrc/ambr.Do not commit notebook outputs. Example
.ipynbfiles inexamples/should stay small.Do not commit manuscript drafts (
paper/is gitignored); cite the public arXiv paper only.Prefer
pyproject.tomlextras over hand-editingrequirements*.txt.Package surface is enforced by
MANIFEST.inand the release workflow (sdist must not containbenchmarks/,docs/,paper/,tests/).
Community Guidelines
- Be Respectful
Use welcoming and inclusive language
Respect differing viewpoints
Focus on constructive feedback
- Be Collaborative
Help others learn and contribute
Share knowledge and expertise
Acknowledge contributions
- Be Patient
Maintainers are volunteers
Reviews and responses take time
Complex changes require thorough review
Getting Help
If you need help:
Check existing documentation
Search GitHub Issues
Ask questions in discussions
Contact maintainers directly
Thank you for contributing to AMBER!