Installation¶
Requirements¶
- Python 3.10–3.12
- PyTorch 2.x — install a CPU or CUDA build appropriate for your machine
pinn-rk runs in float64 throughout. The residual divides differences of network
outputs by the slab size k, which amplifies rounding error by 1/k; in float32 that
noise can swamp the quantity being minimised.
From PyPI¶
That is the library and its only runtime dependencies, numpy and torch.
The optional groups are not pip extras
matplotlib, jupyter, plotly and the docs toolchain are Poetry groups, not
pip extras, so pip install "pinn-rk[examples]" does not work. Install from a
clone if you want the notebooks or the plotting flags.
From source¶
That installs the runtime dependencies (numpy, torch) and the development group
(pytest, ruff, mypy, bandit, pre-commit).
Optional dependency groups¶
Both are optional and off by default, so a plain install stays small.
poetry install --with examples # matplotlib, jupyter, plotly -> notebooks and plots
poetry install --with docs # mkdocs and friends -> this site
--with examples is what you need for examples/notebooks/ and for the --save-plots
flag on the convergence study.
Verifying the install¶
A quick end-to-end check that exercises the actual numerics rather than just the import:
This runs in seconds and prints measured convergence rates. If the fitted orders come out near the theoretical values, the installation is sound.
Development setup¶
Before opening a pull request:
CI runs exactly these on Linux, macOS and Windows across Python 3.10–3.12.
A note on Windows¶
Installing PyTorch into a deeply nested virtualenv path can fail with WinError 206
(“filename or extension is too long”) while unpacking its bundled third-party licence
tree. This is a MAX_PATH limitation rather than a packaging fault. Either enable long
paths in Windows, or place the virtualenv nearer the drive root: