1.8 KiB
Magma Jupyter Kernel
A simple Jupyter kernel for the Magma computer algebra system.
Requirements
-
Magma must be installed and runnable using the standard path, i.e., typing the command
magma
will run Magma. -
Jupyter running on Python 3.
Installation
If pip
and python
point to their Python 3 versions, you can install the kernel as a user with
the commands:
pip install git+https://git.phc.dm.unipi.it/phc/magma_kernel
python -m magma_kernel.install
On some systems, you may need to use pip3
and python3
instead.
Using a remote magma installation
If the magma instance is on a remote machine, you can add an ssh key to the remote machine and add
the following function in your .bashrc
or .zshrc
function magma() {
ssh -qt user@remote "magma $*"
}
Then, you can use it "locally" with the following command:
$ magma
Usage
To use the kernel, run one of the following commands
# Select "New" -> "Notebook" and then in the new tab select "Magma" as the kernel
jupyter notebook
# Or run the console with the Magma kernel (still better than pure magma)
jupyter console --kernel magma
Development
To install the kernel in development mode, clone the repository and run
# Create a virtual environment
python -m venv venv
source venv/bin/activate
# Locally install the kernel
pip install -r requirements.txt
python -m magma_kernel.install
Credits
This code is based on a Magma kernel for IPython written by @nbruin, which was in turn based on @cgranade/magma_kernel the Bash example kernel by Thomas Kluyver. Improvements made in the current version include:
-
Removed some deprecated function usages
-
Added a
requirements.txt
file