Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pik-copan/pyunicorn
Browse files Browse the repository at this point in the history
  • Loading branch information
fkuehlein committed Feb 2, 2024
2 parents 191320a + f1b6e71 commit 1bd9ab8
Show file tree
Hide file tree
Showing 17 changed files with 446 additions and 909 deletions.
160 changes: 99 additions & 61 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,113 @@
# This file is part of pyunicorn.
# Copyright (C) 2008--2024 Jonathan F. Donges and pyunicorn authors
# URL: <http://www.pik-potsdam.de/members/donges/software>
# License: BSD (3-clause)


# documentation & validation ==================================================

# - https://docs.travis-ci.com/user/reference/overview
# - https://docs.travis-ci.com/user/build-matrix/
# - https://docs.travis-ci.com/user/multi-os/

# - https://docs.travis-ci.com/user/build-config-validation/
# - https://config.travis-ci.com/explore


# meta ========================================================================

# enable build config validation
version: ~> 1.0

# require the branch name to be master
# save Travis budget
if: branch = master

language: python
python:
# https://docs.travis-ci.com/user/languages/python/#python-versions
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12-dev"
matrix:
fast_finish: true
# report outcomes
notifications:
email:
on_success: change
on_failure: always


# default jobs: Linux, all Python versions ====================================

arch: arm64
virt: lxd
os: linux
dist: focal
sudo: false

before_install:
# Python package manager
- travis_retry wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"; hash -r
- conda config --set quiet yes --set always_yes yes --set changeps1 no
- travis_retry conda update -n base -c defaults conda
- travis_retry conda update --all
- conda config --set solver libmamba

# debugging info
- conda info -a
- conda list
arch: arm64
virt: lxd
language: generic
env:
jobs:
- PYTHON=3.12
- PYTHON=3.11
- PYTHON=3.10
- PYTHON=3.9
- PYTHON=3.8

before_install: export ARCH=Linux-aarch64 SED=sed

install:
# runtime dependencies
- travis_retry conda create -n test-env
- eval "$(conda shell.bash hook)"
- conda activate test-env
- travis_retry conda install -c conda-forge python=${TRAVIS_PYTHON_VERSION%-dev}
- travis_retry conda install -c conda-forge numpy scipy python-igraph h5netcdf tqdm
- travis_retry conda update -c conda-forge --all

# testing dependencies
- travis_retry conda install -c conda-forge tox flake8 pylint pytest-xdist pytest-cov codecov
- travis_retry conda install -c conda-forge networkx matplotlib cartopy
- travis_retry conda install -c conda-forge sphinx ipython nbsphinx nbsphinx-link

# debugging info
- conda info -a
- conda list

before_script:
# limit parallel processes to available cores (error if pattern not found)
- sed -i '/nthreads=./{s//nthreads=2/;h}; ${x;/./{x;q0};x;q1}' setup.py
- sed -i '/-j ./ {s//-j 2/; h}; ${x;/./{x;q0};x;q1}' setup.cfg
- sed -i '/-n auto/ {s//-n 2/; h}; ${x;/./{x;q0};x;q1}' pyproject.toml
- sed -i '/jobs = ./ {s//jobs = 2/; h}; ${x;/./{x;q0};x;q1}' pyproject.toml
- | # install Python via Miniconda
travis_retry wget https://repo.anaconda.com/miniconda/Miniconda3-latest-${ARCH}.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"; hash -r
conda config --set quiet yes --set always_yes yes --set changeps1 no
- |
travis_retry conda update -n base -c defaults conda
travis_retry conda update --all
conda config --set solver libmamba
conda info -a
conda list
travis_retry conda create -n test-env
eval "$(conda shell.bash hook)"
conda activate test-env
travis_retry conda install -c conda-forge python=${PYTHON}
- | # install dependencies
travis_retry conda install -c conda-forge numpy scipy python-igraph h5netcdf tqdm
travis_retry conda update -c conda-forge --all
travis_retry conda install -c conda-forge tox flake8 pylint pytest-xdist pytest-cov codecov
travis_retry conda install -c conda-forge networkx matplotlib cartopy sphinx
conda info -a
conda list
script:
# package
- travis_retry pip install -v -e ".[testing,docs]"
- | # limit procs to available cores (use GNU `sed`, fail if pattern not found)
${SED} -i '/nthreads=./{s//nthreads=2/;h}; ${x;/./{x;q0};x;q1}' setup.py
${SED} -i '/-j ./ {s//-j 2/; h}; ${x;/./{x;q0};x;q1}' setup.cfg
${SED} -i '/-n auto/ {s//-n 2/; h}; ${x;/./{x;q0};x;q1}' pyproject.toml
${SED} -i '/jobs = ./ {s//jobs = 2/; h}; ${x;/./{x;q0};x;q1}' pyproject.toml
# test suite
- tox -v
# install self (and dependencies, if on Windows)
- travis_retry pip install -v -e ".[tests,docs]"

after_success:
- codecov
# run test suite
- tox -v

notifications:
email:
on_success: change
on_failure: always
# report statistics
after_success: codecov


# modified jobs: OSX + Windows, newest Python version =========================
# (inherit only 1st `env.jobs` entry)

jobs:
fast_finish: true
include:
- os: osx
osx_image: xcode14
language: shell
before_install:
- export ARCH=MacOSX-x86_64 SED=gsed
- export HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1
- travis_retry brew install gnu-sed

- os: windows
language: shell
before_install:
- export ARCH=Windows-x86_64 SED=sed
- export PATH=/c/Python${PYTHON/.}:/c/Python${PYTHON/.}/Scripts:${PATH}
install:
- | # install Python via Chocolatey
travis_retry choco install python --version ${PYTHON}
travis_retry python -m pip install --upgrade pip
15 changes: 6 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ Installation
Dependencies
............
``pyunicorn`` is implemented in `Python 3 <https://docs.python.org/3/>`_ and
`Cython 3 <https://cython.org/>`_, and is tested on *Linux*, *macOS* and
*Windows*. It relies on the following open source or freely available packages,
which need to be installed on your machine. For exact dependency information,
see ``setup.cfg``.
`Cython 3 <https://cython.org/>`_, and is `tested
<https://app.travis-ci.com/github/pik-copan/pyunicorn>`_ on *Linux*, *macOS*
and *Windows*. It relies on the following open source or freely available
packages, which need to be installed on your machine. For exact dependency
information, see ``setup.cfg``.

Required at runtime:
- `numpy <http://www.numpy.org/>`_
Expand All @@ -92,11 +93,7 @@ Required at runtime:
(for ``Data`` and ``NetCDFDictionary``)

Optional *(used only in certain classes and methods)*:
- `PyNGL <http://www.pyngl.ucar.edu/Download/>`_
(for ``NetCDFDictionary``)
- `Matplotlib <http://matplotlib.org/>`_
- `Matplotlib Basemap Toolkit <http://matplotlib.org/basemap/>`_
(for drawing maps)
- `Cartopy <https://scitools.org.uk/cartopy/docs/latest/index.html>`_
(for some plotting features)
- `mpi4py <https://github.com/mpi4py/mpi4py>`_
Expand Down Expand Up @@ -154,7 +151,7 @@ please make sure that all tests pass. The test suite is managed by `tox
<http://tox.readthedocs.io/>`_ and is configured to use system-wide packages
when available. Install the test dependencies as follows::

$> pip install .[testing]
$> pip install .[tests]

The test suite can be run from anywhere in the project tree by issuing::

Expand Down
4 changes: 2 additions & 2 deletions docs/source/api/climate/map_plots.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

climate.map_plots
climate.map_plot
=================

.. automodule:: pyunicorn.climate.map_plots
.. automodule:: pyunicorn.climate.map_plot
:synopsis: spatially embedded complex networks, multivariate data,
time series surrogates
:members:
Expand Down
Loading

0 comments on commit 1bd9ab8

Please sign in to comment.