ESA CCI Toolbox (Cate) Python package, API and CLI.
Cate can be installed into a new or existing Python 3.7 Miniconda or Anaconda environment as follows:
$ conda install -c ccitools cate-cli
Cate's sources (this repository) are organised as follows:
setup.py
- main build script to be run with Python 3.6+cate/
- main package and production codetest/
- test package and test codedoc/
- documentation in Sphinx/RST format
We recommend installing Cate into an isolated Python 3 environment, because this approach avoids clashes with existing versions of Cate's 3rd-party Python package requirements. Using Miniconda or Anaconda will usually avoid platform-specific issues caused by module native binaries.
The first step is to clone latest Cate code and step into the check out directory:
$ git clone https://github.com/CCI-Tools/cate.git
$ cd cate
Conda is the package manager used by the Miniconda or Anaconda Python distributions.
Creating a new Python environment for Cate will require around 2.2 GB disk space on Linux/Darwin and and 1.2
GB on Windows. To create a new Conda environment cate-env
in your Anaconda/Miniconda installation directory, type:
$ conda env create
If you want the environment to be installed in another location, e.g. due to disk space limitations, type:
$ conda env create --prefix some/other/location/for/cate
Next step is to activate the new environment. On Linux/Darwin type:
$ source activate cate-env
In case you used another location use it instead of the name cate
.
Windows users can omit the source
command and just type
> activate cate-env
You can now safely install Cate sources into the new cate-env
environment.
(cate-env) $ python setup.py install
If you run it with the standard CPython installation, make sure you use a 64-bit version. Cate relies on new Python language features and therefore requires Python 3.6+.
Cate can be run from sources directly, once the following module requirements are resolved:
cartopy
dask
fiona
geopandas
jdcal
matplotlib
netcdf4
numba
numpy
pillow
pyqt
scipy
tornado
xarray
The most up-to-date list of module requirements is found in the project's environment.yml
file.
To install Cate into an existing Python 3.6+ environment just for the current user, use
$ python3 setup.py install --user
To install Cate for development and for the current user, use
$ python3 setup.py develop --user
To test the installation, first run the Cate command-line interface. Type
$ cate -h
IPython notebooks for various Cate use cases are on the way, they will appear in the project's notebooks folder.
To use them interactively, you'll need to install Jupyter and run its Notebook app:
$ conda install jupyter
$ jupyter notebook
Open the notebooks
folder and select a use case.
There is a dedicated repository cate-conda which provides scripts and configuration files to build Cate's Conda packages and a stand-alone installer.
Contributors are asked to read and adhere to our Developer Guide.
For unit testing we use pytest
and its coverage plugin pytest-cov
.
To run the unit-tests with coverage, type
$ export NUMBA_DISABLE_JIT=1
$ py.test --cov=cate test
We need to set environment variable NUMBA_DISABLE_JIT
to disable JIT compilation by numba
, so that
coverage reaches the actual Python code. We use Numba's JIT compilation to speed up numeric Python
number crunching code.
Other recognized environment variables to customize the unit-level tests are
CATE_DISABLE_WEB_TESTS=1
CATE_DISABLE_PLOT_TESTS=1
CATE_DISABLE_GEOPANDAS_TESTS=1
CATE_DISABLE_CLI_UPDATE_TESTS=1
We use the wonderful Sphinx tool to generate Cate's documentation on ReadTheDocs. If there is a need to build the docs locally, first create a Conda environment:
$ cd cate
$ conda env create -f environment-rtd.yml
To regenerate the HTML docs, type
$ cd doc
$ make html
The CCI Toolbox is distributed under terms and conditions of the MIT license.