Installation#

PyCIF is a Python package that can be installed with pip. While 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 module command on computing clusters.

Tip

A Docker image with all requirements pre-installed is available on Docker Hub. See CIF in Docker documentation for details on the CIF docker image.

Here is a list of PyCIF dependencies:

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 pip:

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 pip (preferably in editable mode):

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 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:

python -c 'from osgeo import gdal_array'

If not, you can re-install the GDAL Python package properly with:

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 models documentation.