Skip to content

fix: Python interface compatibility - update requires-python and fix examples#933

Open
ethanio12345 wants to merge 4 commits intoRTKConsortium:mainfrom
ethanio12345:develop
Open

fix: Python interface compatibility - update requires-python and fix examples#933
ethanio12345 wants to merge 4 commits intoRTKConsortium:mainfrom
ethanio12345:develop

Conversation

@ethanio12345
Copy link
Copy Markdown

@ethanio12345 ethanio12345 commented Apr 17, 2026

Description

This PR fixes the Python interface for the RTK package to work with the current itk-rtk PyPI distribution.

Changes Made

pyproject.toml Fix

  • Updated requires-python from ">=3.8" to ">=3.10" to resolve dependency conflicts with sphinx>=7.2.6 and myst-parser[linkify]
  • Added uv.lock for dependency reproducibility

Python Example Fixes

  • FirstReconstruction.py: Fixed FDKConeBeamReconstructionFilter template parameter count (3→1)
  • InlineReconstruction.py: Fixed ParkerShortScanImageFilter and FDKConeBeamReconstructionFilter template parameter counts
  • ConjugateGradient.py: Rewritten to use core RTK API instead of application-level functions not in PyPI package
  • GeometricPhantom.py: Switched to built-in Shepp-Logan phantom instead of missing "Thorax" config file
  • WaterPreCorrection.py: Added auto-generation of test data when output directory is missing

Other

  • Updated .gitignore to exclude generated example output files

…atibility

- sphinx>=7.2.6 requires Python >=3.10
- myst-parser[linkify] recent versions require Python >=3.10
- Python 3.8 EOL Oct 2024, 3.9 EOL Oct 2025
- ITK 5.4.x supports Python 3.10+
- Fix template parameter count for FDKConeBeamReconstructionFilter
  (1 param instead of 3) in FirstReconstruction and InlineReconstruction
- Fix template parameter count for ParkerShortScanImageFilter
  (1 param instead of 2) in InlineReconstruction
- Rewrite ConjugateGradient to use core RTK API instead of
  application-level functions (rtksimulatedgeometry, rtkprojectgeometricphantom)
- Update GeometricPhantom to use Shepp-Logan phantom filters instead
  of config_file='Thorax' which is not bundled with the pip package
- Make WaterPreCorrection self-contained by auto-generating test data
  when the output/ directory does not exist
@ethanio12345
Copy link
Copy Markdown
Author

Actually, I might leave these open (at least for y'all to close). I had some package conflicts and uv suggests py 3.10 for the sphinx. There were some missing files not available when I did git clone to run the examples.

@ethanio12345 ethanio12345 reopened this Apr 17, 2026
@SimonRit
Copy link
Copy Markdown
Collaborator

I think the issue is that the current package release is incompatible with the doc on the main branch since #919. However, you can download the latest python package as GitHub artifacts on the CI as artifacts from the workflows https://github.com/RTKConsortium/RTK/pull/919/checks.

@axel-grc should we consider rolling back the doc to one compatible with the current pypi packages and produce python packages with backward compatibility until the next release?

@acoussat
Copy link
Copy Markdown
Collaborator

As a more general comment, shouldn't the landing page of https://docs.openrtk.org be https://docs.openrtk.org/en/v2.7.0/ instead of https://docs.openrtk.org/en/latest/?

@axel-grc
Copy link
Copy Markdown
Collaborator

instead

That could be a solution, but that would hide the latest changes in the c++ side.
Maybe we could consider to add a warning in the latest doc to refer to the 2.7 doc when installing the package with pip install itk-rtk ?

@SimonRit
Copy link
Copy Markdown
Collaborator

I prefer to use latest as the default. +1 for adding a note in INSTALLATION.md on how to download the latest package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants