Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Verified Commit f1724e79 authored by Qusai Al Shidi's avatar Qusai Al Shidi 💬
Browse files

Added instructions for python venv and also snippets to contributing page.

parent d0a83080
......@@ -76,6 +76,12 @@ def my_new_func(some_args):
# function body
There are helpful snippets for these:
- function $91
- class $92
- file $93
......@@ -10,10 +10,12 @@ This is a work in progress.
Clone into the directory you want to use it.
*Note*: swmfpy also is part of the SWMF and gets cloned into `SWMF/share/Python`. However, if you would like to [develop](CONTRIBUTING.markdown) for swmfpy make a clone and work that way and make a merge request.
There are two methods of installing swmfpy with with a virtual environment and without a virtual environment. Only use the virtual environment if your current environment is giving you trouble.
### Without Python venv
Install with [pip](
......@@ -29,6 +31,45 @@ Then import it into your python project.
import swmfpy
### With Python venv
Use this method if the above method is giving you trouble.
Set up a python 3 virtual environment:
$ python3 -m venv ~/.venv
This is important, make sure that it is in your `.profile` or `.bash_profile`:
$ echo "source ~/.venv/bin/activate" >> ~/.profile
*Note*: You might need to use `activate.csh` instead if using `csh` and `` in your `~/.config/fish/` instead if using `fish` shell. You are most likely using `bash` so no need to worry.
Next install the software. This will take a long time as you will be compiling `numpy` from scratch.
$ source ~/.venv/bin/activate
$ python3 -m pip install --user wheel -vvv
$ python3 -m pip install --user cython -vvv
$ python3 -m pip install --user swmfpy -vvv
If you are using `tmux` or `GNU Screen` on a supercomputer you can safely detach your session and power off your computer and come back another time.
This should be fully installed now. You should be able to import:
import swmfpy
### Troubleshooting
If you have followed these carefully and still not been able to install please submit an Issue.
......@@ -46,3 +87,18 @@ Issues
If you are experiencing any issues or bugs please go to the [Issues]( page and create an issue. Make sure you include steps to recreate the problem in your post.
How to cite
You can cite this software on LaTeX like this:
author = {{Qusai Al Shidi}},
title = {swmfpy},
url = {},
version = {2020.5},
date = {2020-06-19},
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment