Select Git revision
dgelessus authored
This allows using Jupyter's Python API to install the kernel. It returns the location of the newly installed kernelspec, which allows copying the kernel jar file into the kernelspec directory instead of the ProB home directory. This is cleaner and allows fully uninstalling the kernel using a single command. Additionally, we no longer depend on Guice to generate the kernel.json (we use Python's json module instead) and no longer use the deprecated Main.getProBDirectory method from ProB 2. The Python script for installing the kernel is bundled into the kernel jar as __main__.py, which allows running the jar file using Python. The installation can still be started using Java, in which case the jar re-executes itself using Python. Yes, this is a little bit cursed, but it works.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Makefile 1.02 KiB
run:
jupyter notebook
rebuild:
./gradlew shadowJar
install:
./gradlew installKernelSpec
USERNAME=
PROB_HOME=/Users/$(USERNAME)/git_root/prob_prolog
PYTHON=/Users/$(USERNAME)/opt/miniconda3/bin/python3
#PYTHON=/Users/$(USERNAME)/opt/miniconda3/envs/py10/bin/python3
installph:
./gradlew -PpythonCommand=$(PYTHON) installKernelSpec
installphuser:
echo "Installing for user, so that, e.g., VSCode sees the kernel"
./gradlew -PpythonCommand=$(PYTHON) -PkernelspecUserInstall=true installKernelSpec
console:
jupyter console --kernel prob2
NOTEBOOKS = notebooks/tutorials/prob_solver_intro.ipynb \
notebooks/manual/ExternalFunctions.ipynb
latex:
for spec in $(NOTEBOOKS); do \
echo 'Generating Latex for: '; echo $$spec ; \
jupyter nbconvert $$spec --to latex ; \
done
echo "done"
slides:
jupyter nbconvert notebooks/presentations/SETS_RODIN18.ipynb --to slides --post serve
slidespdf:
jupyter nbconvert notebooks/presentations/SETS_RODIN18.ipynb --to latex
pdflatex notebooks/presentations/SETS_RODIN18.tex