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
virtualenvand 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
cleaveto yourrequirements.txt:
# example requirements.txt
...
numpy
pandas
cleave
scipy
(venv) $ pip install -Ur ./requirements.txt
From the repository¶
Set up a
virtualenvand 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
pipby 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.txtfile:
# 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+
virtualenvand 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-apidocsfrom the top-level directory and passing it the output directory (docs/source) and thecleavepackage 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.