For the tutorial¶
This tutorial uses a sampler of Scikit-HEP project packages (Uproot, Awkward Array, hist, Vector, zfit, Particle, fastjet), which are all components that you might or might not use in your analysis, as well as Python 3, NumPy, and a smattering of other mainstream libraries (Pandas, Matplotlib, JupyterLab, Numba).
Rather than asking you to install them all, we provide two different ways to run everything in your browser: GitHub Codespaces and Binder. We recommend that you use GitHub Codespaces (see instructions below). If this is not an option for you, you can use Binder, though be aware that the resources might be very limited.
GitHub codespaces¶
In order to use GitHub codespaces, you need to create an account with GitHub (it’s free! You can also enter their education program for additional free stuff).
Click the following button (a new page will open), then return to these instructions:
After starting the github codespace, take a look at the lines in the “Terminal” tab below. It might take a while until the environment is fully set up. If you see lines like this:
Use Cmd/Ctrl + Shift + P -> View Creation Log to see full logs
✔ Finishing up...
✔ Running updateContentCommand...
⠦ Running postCreateCommand...
› python3 -m pip install -r requirements.txtthe installation is still progressing. This will take around 5 minutes, so just be patient.
Once you’re done, you should only see an empty prompt like this:
@klieret ➜ /workspaces/hsf-training-scikit-hep-webpage (main) $Wait for a few seconds to see that nothing else runs.
You’re ready to go 🎉
You can view and run the notebooks from the VSCode interface. However, if you prefer to use JupyterLab, you can append ?editor=jupyter to the URL in you browser so that it looks like this: https://<your-codespace-id>.github.dev/?editor=jupyter. Alternatively, you can go to your codespaces, find the codespace you just created, click on the three dots on the right side, and select “Open in JupyterLab”.
Binder¶
Simply click the following button:
After the tutorial¶
If you want to install some of these packages on your own or your lab’s computer, I recommend Miniforge (or Anaconda/Miniconda with the conda-forge channel). This method also provides a way to install ROOT in the same environment. To setup the environment use the environment.yml file in the root of this repository as:
conda env create -f environment.ymlor you can install individual packages as needed, e.g.,
conda install uproot awkward # ... others?Alternatively, you can install all required packages locally with pip with
pip install -r requirements.txtor individually, e.g.,
pip install uproot awkward # ... others?Note that some packages (e.g. xrootd) will need to be built from source if installed with pip, so conda is the recommended installation method.