Development
Pixi Environments
The repository is organized around a small set of Pixi environments:
default: editable package install plus core runtime dependenciestest: addspytestcompare: addsmatplotlibandmtrfdocs: adds MkDocs and API-reference tooling
Common Commands
pixi install
pixi run import-check
pixi run -e test test
pixi run -e docs docs-build
pixi run -e docs docs-serve
pixi run -e compare compare-demo
pixi run -e compare benchmark-demo
Editable Install Without Pixi
pip install -e .
pip install -e ".[test]"
pip install -e ".[docs]"
Use the Pixi docs environment for the most reproducible site builds, because
CI builds the documentation from the lockfile-backed toolchain:
pixi run -e docs docs-build
Package Layout
src/fftrf/estimator.py:TRFsrc/fftrf/metrics.py: scoring functions and metric resolutionsrc/fftrf/results.py: result dataclassessrc/fftrf/spectral.py: spectral cache and solver helperssrc/fftrf/prediction.py: prediction, CV scoring, and bootstrap helperssrc/fftrf/utils.py: validation and small shared utilities
src/fftrf/model.py remains as a thin import surface inside the package, while
the main implementation lives in the smaller submodules above.
Performance Notes
Cross-validation performance relies on two different kinds of reuse:
src/fftrf/spectral.pycaches per-trial spectral sufficient statistics so folds and ridge candidates do not repeat FFT-based training statistics.src/fftrf/prediction.pynow caches validation-side predictor FFTs within each fold, so repeated candidate scoring reuses the same transformed predictors instead of recomputing one convolution per input/output kernel.
That second optimization is especially relevant for larger CV grids and banded regularization, because it lowers scoring cost without changing any public API, fit result, or score value.