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¶
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) $
Next, install the framework from PyPI using
pip
:
(venv) $ pip install cleave
Alternatively, if you already have set up a project with an associated virtualenv, you can add
cleave
to yourrequirements.txt
:
# example requirements.txt
...
numpy
pandas
cleave
scipy
(venv) $ pip install -Ur ./requirements.txt
From the repository¶
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) $
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
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¶
Clone the CLEAVE repository:
$ git clone git@github.com:KTH-EXPECA/CLEAVE.git
$ cd ./CLEAVE
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¶
Install the documentation dependencies:
(venv) $ pip install -Ur requirements_docs.txt
Document code using the Numpy docstring format (see below).
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 thecleave
package directory as arguments:
$ sphinx-apidoc -fo docs/source ./cleave
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.