ComPWA / compwa.github.io

Source code for the ComPWA Organization website
https://compwa.github.io
Apache License 2.0
5 stars 4 forks source link

Pin all dependencies in the technical reports #273

Open redeboer opened 4 months ago

redeboer commented 4 months ago

Currently, TRs have a pip install statement where the packages that are required for the notebook itself. The packages are pinned to a specific version in an attempt to make the notebook reproducible, but indirect dependencies are not pinned. This results in bugs like #272.

Unfortunately, Jupyter notebooks do not support launching sub-kernels. That would be the ideal solution: you have a main developer environment for the repository that you can for instance use to start Jupyter Lab, and then each notebook launches a subkernel with it's own specific set of dependencies.

The closest we can get to an isolated kernel is by doing a pip install with --prefix and then using sys.path.insert to import from that directory. You can create a constraint file for all indirect dependencies with pip compile (or faster: uv pip compile). Providing a constraint file for each notebook then makes each technical report reproducible.

Disadvantages: