Scikit-HEP Tutorial: Setup

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:

Launch GitHub Codespaces

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.txt

the installation is still progressing.

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.

Now look at your left side-panel. You should see a file named notebook.ipynb. Click on it. A new tab with the notebook opens.

Note

If the notebook does not show up after several minutes (and you only see the “blue progress bar” on top), you might want to try a different browser. There have been reports about this happening with Safari on OSX and with firefox private windows.

Try to execute the first line to see that everything is set up properly.

You’re ready to go 🎉

Binder

Simply click the following button:

Launch Binder

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 base of this repository as:

conda install uproot awkward   # ... others?

Alternatively, you can install all required packages locally with pip: Take a look at requirements.txt for a list.