Installing PyRETIS
==================

PyRETIS and its requirements can be installed using pip or conda.
PyRETIS requires **Python 3.11** or newer.

For the maintained installation instructions, please see
``docs/user/install.rst``. The short version is included below.


Installing PyRETIS using pip or conda
-------------------------------------

The latest release of the PyRETIS library can be installed using conda:

```
conda install pyretis -c conda-forge
```

or using pip:

```
python -m pip install pyretis
```

To use the optional PyVisA GUI and advanced analysis tooling, install:

```
python -m pip install pyqt5 mdtraj graphviz
```

Installing PyRETIS from the source code
---------------------------------------

Previous versions of PyRETIS and the latest sources can be obtained
using git:

```
git clone git@gitlab.com:pyretis/pyretis.git
```

or alternatively:

```
git clone https://gitlab.com/pyretis/pyretis.git
```

After cloning the repository, PyRETIS can be installed
as follows:

```
cd pyretis
python -m pip install .
```

Installing the development version of PyRETIS
---------------------------------------------

After cloning the repository as described above,
check out the development branch you are interested in, e.g.:

```
git checkout develop
```

Then, install the PyRETIS development requirements (these
are defined in the file ``requirements-dev.txt``):

```
pip install -r requirements-dev.txt
```

Finally, install PyRETIS using,

```
python -m pip install -e .
```

Testing your installation
-------------------------

Your installation can be tested by running the tests from the
main directory:

```
python -m pytest -v test/
```

Building the documentation
--------------------------
Building the documentation depends upon first installing the
requirements for the PyRETIS development version.
As described above, this can be done using
(from the main source directory):

```
pip install -r requirements-dev.txt
```

The documentation for PyRETIS can then be created (from
the ``docs`` directory) by:

```
make html
```

This will generate the documentation in HTML format
in the directory ``docs/_build/html/``. The documentation
can be viewed by opening the file ``docs/_build/html/index.html``.
