Installation

Installation for general usage

NOTE: Although these instructions will eventually be the recommended way of downloading and installing the framework, they are currently a work-in-progress, and do not work yet. For failsafe ways to install the framework, see section Installation for development below.

From PyPI

  1. Set up a Python virtualenv and activate it:

$ virtualenv --python=python3.8 ./venv
created virtual environment CPython3.8.3.final.0-64 in 212ms
$ . ./venv/bin/activate
(venv) $
  1. Next, install the framework from PyPI using pip:

(venv) $ pip install cleave
  1. Alternatively, if you already have set up a project with an associated virtualenv, you can add cleave to your requirements.txt :

# example requirements.txt
...
numpy
pandas
cleave
scipy
(venv) $ pip install -Ur ./requirements.txt

From the repository

  1. Set up a virtualenv and activate it as before:

$ virtualenv --python=python3.8 ./venv
created virtual environment CPython3.8.3.final.0-64 in 212ms
$ . ./venv/bin/activate
(venv) $
  1. Install the package through pip by explicitly pointing it toward the repository:

(venv) $ pip install -U git+git://github.com/KTH-EXPECA/CLEAVE.git#egg=cleave
  1. This can also be inserted into a requirements.txt file:

# example requirements.txt
...
numpy
pandas
-e git://github.com/KTH-EXPECA/CLEAVE.git#egg=cleave
scipy

Installation for development

  1. Clone the CLEAVE repository:

$ git clone git@github.com:KTH-EXPECA/CLEAVE.git
$ cd ./CLEAVE
  1. Create a Python 3.8+ virtualenv and install the development dependencies:

$ virtualenv --python=python3.8 ./venv
created virtual environment CPython3.8.3.final.0-64 in 212ms
...

$ . ./venv/bin/activate
(venv) $ pip install -Ur ./requirements.txt
...

(Optional) Set up the Sphinx documentation environment

  1. Install the documentation dependencies:

(venv) $ pip install -Ur requirements_docs.txt
  1. Document code using the Numpy docstring format (see below).

  2. Generate reStructured text files for the code by running sphinx-apidocs from the top-level directory and passing it the output directory (docs/source) and the cleave package directory as arguments:

$ sphinx-apidoc -fo docs/source ./cleave
  1. Finally, to preview what the documentation will look like when published on readthedocs, build it with GNU Make:

$ cd docs/
$ make html

The compiled HTML structure will be output to docs/build, from where it can be viewed in a browser.