Write a Jupyter kernel for the new DSL
Solving this issue should be after issue https://git.scc.kit.edu/virtmat-tools/vre-language/-/issues/56 is soved.
This should be a new repo but for first it can be in this repo.
Two links that might be helpful:
- https://jupyter-client.readthedocs.io/en/stable/kernels.html
- https://ipython-books.github.io/16-creating-a-simple-kernel-for-jupyter/
- https://github.com/jupyter/jupyter/wiki/Jupyter-kernels
See also:
The current implementation is based on Ref. 1 above. It is a simple Jupyter Kernel called "VirtMat", derived from the Kernel class in ipykernel.kernelbase. It further supports auto-completion (Tab key) of variable and function names that it knows from previous cells that already have been run. The keys "print" and "use" are always auto-completed, even in the very first cell.
To run the kernel, change directories to vre-language/virtmat_kernel
and run python -m virtmat_kernel.install
. Another directory .local/share/jupyter/kernels/virtmat
which contains the kernelspec file "kernel.json" should appear in the $HOME directory. To check this, run jupyter kernelspec list
. Then, after opening a jupyter notebook, a new kernel called "VirtMat" should appear in the drop-down menu on the top right.