Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you build your own conda environment - or want to use one of your colleagues one -  which contains a python jupyter kernel (package ipykernel) you can make it visible to the jupyter hub by creating a kernelspec files. This is also useful if you want to have a kernel that points to an old psana release.  To do that you can copy/modify kernel files from /reg/g/psdm/sw/conda/jhub_config/prod-rhel7/kernels/ in the subdirectories.  The subdirectories ana1-current, ana1-current-py3 are for LCLS1 psana (py2 and py3 versions) and subdirectory ana2-current for LCLS2 psana (py3 only).

For a user the spec files are located in ~/.local/share/jupyter/kernels/ with a sub-directory for each spec. The kernel.json in a spec directory contains the settings. For an example see  ~wilko/.local/share/jupyter/kernels/example/.

...

Code Block
% conda activate <your-env>
% ipython kernel install --user --name "a-name-you-like"

You can also copy the files

The --name option is the name for the kernelspec - the directory that will be created in ~/.local/share/jupyter/kernels/. There are a few more install options - ipython kernel install -h - the most useful one is --display-name  that allows to set the name shown in Jupyter. Instead of using the command above one can also create the directory and the kernel.json file by hand. You

...