Skip to content

Getting started

Environments

pySRX uses pixi for reproducible environments (conda-forge, Python 3.12, linux-64).

Environment Use Torch
default development, tests, CI CPU (pytorch-cpu)
cuda reconstructions on a GPU CUDA 12 (pytorch-gpu, CuPy)
docs this site and the Slidev deck CPU, plus mkdocs-material, mkdocstrings, Node.js
pixi install                 # default environment
pixi run test                # pytest, CPU
pixi run lint                # ruff
pixi run -e cuda test        # includes tests marked gpu
pixi run -e docs site        # mkdocs site + slides into site/
pixi run -e docs docs-serve  # live preview on http://127.0.0.1:8000

Tests needing a CUDA device are marked gpu, tests needing real data on a mounted share are marked data. CI deselects both:

pixi run test -m "not gpu and not data"

Using pySRX from a project repository

Project repositories (for example LF4D-Recon) vendor pySRX as a git submodule at dependency/pySRX and install it editable, so a fix made while working on a project lands in pySRX directly.

git submodule add git@github.com:Oxford-Zeiss-Centre-of-Excellence/pySRX.git dependency/pySRX
git submodule update --init --recursive

In the project's pixi.toml:

[pypi-dependencies]
pysrx = { path = "dependency/pySRX", editable = true }

After cloning a project that already uses it:

git clone --recurse-submodules <project-url>
# or, in an existing clone
git submodule update --init --recursive

Commit the submodule pointer in the project repo whenever the project depends on a newer pySRX commit.

Optional extras

Extra Packages Notes
gpu cupy-cuda12x CuPy kernels where faster than torch
io tanoa OME-Zarr reading and writing; private sibling repo, not installed in CI
sr-io tifffile, mrcfile legacy SR-Metrics file formats

All processing input is OME-Zarr written by tanoa; raw CZI is never read by pySRX.