Thank you for your interest in PortPy. Contributions of all kinds are welcome: bug reports, documentation fixes, new example notebooks, new optimization or AI methods, and integrations with other tools.
PortPy-Project is organised as a core repository plus extension repositories:
| Repository | Purpose |
|---|---|
| PortPy (this repo) | Core library, benchmark data access, reference algorithms, example notebooks |
| ECHO-VMAT | Hierarchical (prioritized) automated VMAT planning |
| CompressRTP | Influence-matrix and fluence compression for fast optimization |
| portpy.github.io | Documentation website |
To keep the core lightweight, project-specific research code belongs in an extension repository. You can host it under the PortPy-Project organisation or on your own GitHub; if you choose the latter, let us know and we will feature it.
Please open an issue or email the lead developer (Gourav Jhanwar, jhanwarg@mskcc.org) describing what you plan to do. This avoids duplicate effort and lets us agree on scope and interfaces first.
Open an issue using the Bug report template. Include:
- PortPy version (
python -c "import portpy; print(portpy.__version__)"), Python version, OS - The patient id and protocol you used (if from the PortPy dataset)
- The solver (
MOSEK,CLARABEL,SCS,GUROBI, ...) - A minimal snippet and the full traceback
git clone https://github.com/PortPy-Project/PortPy.git
cd PortPy
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[test]" # add ",ai" for the deep-learning module
pytestNotes:
- Python 3.11 or newer is required.
- The tests download
Lung_Phantom_Patient_1from Hugging Face on first run and solve with the free SCS solver, so no commercial license is needed. - The CI workflow (
.github/workflows/ci.yml) runs the samepyteston Ubuntu / Python 3.12 for every pull request that touchesportpy/.
- Fork the repository and create a branch from
master(for examplefeature/my-change). - Keep pull requests focused. One feature or fix per PR is easiest to review.
- Follow the existing code style:
snake_casefor functions and variables,CamelCasefor classes, type hints and reStructuredText-style docstrings (:param ...:,:return:) as used throughoutportpy/photon/. - Add or update tests under
tests/when you change behaviour. - If you add a public method, make sure it is documented in its docstring; the website's API reference is generated from docstrings.
- If you add or rename an example notebook, update the examples table in
README.mdandexamples/README.md, and add a.pyversion underexamples/python_files/. - Describe what and why in the PR description, and link the related issue.
New notebooks are very welcome. Please:
- Use a patient from the public dataset (prefer
Lung_Phantom_Patient_1or a small down-sampled problem when the goal is to illustrate an idea quickly). - State the requirements at the top (GPU, Eclipse TPS, 3D Slicer, commercial solver).
- Clear large outputs before committing so the repository stays small.
The benchmark dataset is hosted on Hugging Face. If you would like to contribute patients (for example extracted from your Eclipse system with the Varian MAAS-DoseInfluenceMatrix tool), please contact us first; data must be de-identified and shareable under a compatible license.
By contributing you agree that your contributions are licensed under the project's
license: Apache 2.0 with the Commons Clause (non-commercial). See LICENSE.txt.
This project follows the Contributor Covenant. Please be respectful and constructive.