Skip to content
Snippets Groups Projects
Select Git revision
  • 6ea19acdaca0baa3ac9f3da8b6f09562076e0053
  • master default protected
  • exec_auto_adjust_trace
  • let_variables
  • v1.4.1
  • v1.4.0
  • v1.3.0
  • v1.2.0
  • v1.1.0
  • v1.0.0
10 results

prob2-jupyter-kernel

  • Open with
  • Download source code
  • Your workspaces

      A workspace is a virtual sandbox environment for your code in GitLab.

      No agents available to create workspaces. Please consult Workspaces documentation for troubleshooting.

  • user avatar
    dgelessus authored
    ProBKernel is now a singleton (it's very unlikely that we'll ever need
    to run multiple kernels in a single process, and if we do, each would
    have its own injector anyway). This allows injecting it into commands
    when they need it. This makes more sense than using a parameter,
    because most commands don't need access to the kernel object.
    
    We have to use an Injector and inject the kernel only when it's
    actually used. We can't inject the kernel as a constructor parameter,
    because the ProBKernel constructor injects all the commands, which
    would cause a circular dependency.
    6ea19acd
    History

    ProB 2 Jupyter Kernel

    This is a Jupyter kernel for the ProB animator and model checker, based on the ProB 2 Java API and the Jupyter JVM BaseKernel library.

    Note: This project is still in development, features and functionality are not yet stable and may change at any time.

    Requirements

    • Java 8
      • Newer Java versions may work, but are not tested.
    • A Python 3 interpeter with Jupyter installed (python3 -m pip install jupyter)
      • Tested with CPython 3.6 and jupyter-client 5.2.3.
      • Newer Jupyter versions should also work.
      • Older Jupyter versions may work, as long as they support version 5.0 of the Jupyter message protocol.
      • The Python version does not matter, as long as it is supported by Jupyter.

    Installation

    1. Clone this repository (git clone https://gitlab.cs.uni-duesseldorf.de/dgelessus/prob2-jupyter-kernel.git) or download an archive from the repository page.
    2. If Jupyter is installed in a virtual environment, activate it.
    3. In the root directory of the repository, run ./gradlew installKernelSpec.
      • By default, this looks for a Python interpreter named python3 in the PATH and uses it to install the kernel spec. If your Python interpreter is named differently, you can pass -PpythonInterpreter=/path/to/python3 to the ./gradlew command to use a different Python interpreter for the installation.

    To update the kernel, follow the same instructions as for installation. (If you cloned the repository using Git, you can update your existing copy using git pull instead of cloning it again.)

    Note: The compiled kernel jar is currently stored in the Gradle build output folder, and the generated kernel spec has this path hardcoded on installation. If the location of the repository directory changes, you must install the kernel spec again.

    Usage

    After installation, start the Jupyter Notebook web interface using python3 -m jupyter notebook. The ProB 2 kernel can be selected when creating a new notebook.

    You can also use the kernel with other frontends, such as jupyter console and jupyter qtconsole, by specifying --kernel=prob2 on the command line.

    For information on how to use the kernel, run the built-in :help command, or see the included example notebooks.