Installation
============
PyCIF is a Python package that can be installed with `pip `__.
While :bash:`pip` will install all the *Python* dependencies automatically, PyCIF also
rely on some external libraries and tools, that need to be installed first.
Dependencies
------------
PyCIF depends on some external libraries and tools that need to be installed
on your system, or loaded in the environment with the :bash:`module` command
on computing clusters.
.. tip::
A Docker image with all requirements pre-installed is available on
`Docker Hub `__.
See :doc:`CIF in Docker documentation ` for details on the CIF docker image.
Here is a list of PyCIF dependencies:
- `Python `__ (version 3.9 or above)
- rsync
- `git `__
- `ecCodes `__
- `GDAL `__
- `PROJ `__
- `HDF5 `__
- `netCDF4 `__
.. - `graphviz `__
.. note::
Models included in CIF have also their own dependencies (compiler,
parallel computing librairies, NetCDF librairy).
Please refer to the `Dockerfile `__ for a full list of
required packages on Ubuntu based systems.
Installing PyCIF
----------------
Once all the dependencies are installed, you can install PyCIF with one of the
following method:
From a release
~~~~~~~~~~~~~~
.. hint::
Use this installation method if you do not need to modify PyCIF's code.
Download PyCIF wheel form the `latest release `__
or choose another release from the `release page `__.
Install the downloaded wheel file with :bash:`pip`:
.. code-block:: shell
pip install --user pycif-*-py3-none-any.whl
From sources
~~~~~~~~~~~~
.. hint::
Use this installation method if you need to modify PyCIF's code or need to use
some functionalities that are not yet in the latest release.
Clone the `CIF repository `__,
choose the desired branch/commit and install PyCIF with :bash:`pip`
(preferably in editable mode):
.. code-block:: shell
git clone git@gitlab.in2p3.fr:satinv/cif.git
cd cif
git checkout devel # Switch to the development branch, optional
pip install --user --editable .
.. tip::
If PyCIF is installed in editable mode, you can update PyCIF at anytime with :bash:`git pull`
Possible issue with GDAL
------------------------
The GDAL Python package is sometimes not installed with numpy-based raster support.
You can verify that numpy-based raster support has been installed with the command:
.. code-block:: shell
python -c 'from osgeo import gdal_array'
If not, you can re-install the GDAL Python package properly with:
.. code-block:: shell
pip install numpy wheel setuptools>=67
pip install --no-build-isolation --no-cache-dir --force-reinstall gdal==$(gdal-config --version).*
Compiling models
----------------
To compile the models included in CIF, please refer to the
:doc:`models documentation `.