Installation

Supported Python versions

The support for python versions depends on pysiral versions.

pysiral version

python version

<0.7.3

2.7

0.7.3-0.12

3.9

>=0.13

3.10-3.13

Requirements

  • Python (recommended: 3.10 or later for pysiral version >= 0.13)

  • C-compiler (required for compiling cython code)

  • git version control

Installation from github

pysiral is intended to be installed with python 3.10<=3.13since pysiral version >= 0.13. The installation can be done directly from github:

pip install pysiral@git+https://github.com/pysiral/pysiral.git

Installation from source

To install pysiral from source, clone the repository and run the setup script:

git clone https://github.com/pysiral/pysiral.git
cd pysiral
pip install .

Specific Branches

If a specific pysiral version or branch is required, it can be specified in the pip install command:

pip install pysiral@git+https://github.com/pysiral/pysiral.git@production/awi-v2p6

For a full documentation of the syntax see the pip documentation.

Warning

The branches of pysiral are used to ensure consistent product generation for different datasets. That means that users should be aware that each branch may be based on a different pysiral and will have different features and functionality.

Optional Dependencies

Note

Introduced in pysiral version 0.13.

pysiral has some optional dependencies that are not installed by default. There are two categories of optional

  • dev: python packages used for development, e.g. testing, linting, debugging and building of the documentation.

  • ml: python packages used for using machine learning models (e.g. pytorch and xgboost).

Note

The ml extra is only required for using TFMRA retracker threshold models for ERS-1/2 and Envisat for the CCI and C3S products

The optional dependencies can be installed by adding the corresponding extras when installing pysiral. In the examples from above, installing all optional dependencies would look like this:

pip install pysiral[dev,ml]@git+https://github.com/pysiral/pysiral.git

respectively:

git clone https://github.com/pysiral/pysiral.git
cd pysiral
pip install .[dev,ml]

Local Code

For development purpose it may be useful to install pysiral in editable mode. This step requires a manual compilation of Cython code (line 4) and is recommended to install pysiral with all optional dependencies (line 3, pysiral version >= 0.13) and also running the test suite (line 5)

1git clone https://github.com/pysiral/pysiral.git
2cd pysiral
3pip install -e .[dev,ml]
4python setup.py build_ext --inplace
5python -m unittest discover -s tests -t tests