Installing Karawun

Karawun is python package that can be installed via pip or miniconda.

We recommend that you install Karawun in a python virtual environment to avoid clashes with other packages.

There are a variety of choices of python virtual environments

Conda based installation

  1. Install miniconda or anaconda

  2. Add package channels:

    conda config --append channels conda-forge --append channels anaconda --append channels SimpleITK
    
  3. Create an environment for Karawun:

    conda create --name KarawunEnv python=3.8 karawun
    
  4. Activate the environment:

    conda activate KarawunEnv
    
  5. Test the installation by running the main script:

    importTractography -h
    

    This will produce the help information if the installation was successful.

Subsequent uses of karawun only require the conda activate KarawunEnv step.

Pip based installation

Karawun is available via the Python package index and can be installed using pip

  1. Create and activate your choice of virtual environment.

  2. Install with pip

    pip install karawun
    
  3. Test the installation by running the main script:

    importTractography -h
    

    This will produce the help information if the installation was successful.

Verifying your installation

Karawun is tested before packages are distributed. However it is recommended that you duplicate these tests locally, as follows:

  1. Clone the github repository to retrieve the test data (windows users may need to install git separately)

git clone https://github.com/DevelopmentalImagingMCRI/karawun.git
  1. Activate the environment in which Karawun is installed, and install pytest into it. eg.

conda activate KarawunEnv
pip install pytest
  1. Change to the cloned folder

cd karawun
  1. Run the tests

python -m pytest -s tests

The final line should read:

================================================== 3 passed, 2 skipped in 19.35s ===================================================

Skipped tests were run using custom flags to create the baseline results against which new results are compared.