Skip to content

Commit

Permalink
add color support for IPCC AR6 (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
gidden authored and danielhuppmann committed Apr 15, 2019
1 parent 8d3d520 commit 3972e8c
Show file tree
Hide file tree
Showing 55 changed files with 458 additions and 40 deletions.
20 changes: 12 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ language: sh
matrix:
include:
- os: linux
env: PYENV=py37
env: PYENV=py36
- os: linux
env: PYENV=py27
- os: osx
env: PYENV=py37
- os: osx
env: PYENV=py27
env: PYENV=py36
- os: osx
env: PYENV=py37
# Observed on 10-Feb-19, choclatey builds for miniconda3 break
# see: https://github.com/conda/conda/issues/6064
# It is not clear how/when this can be fixed, so turn this back off for now
Expand All @@ -21,17 +21,21 @@ matrix:

before_install:
- source ./ci/env.sh
- bash ./ci/travis-install.sh
- bash ./ci/travis-install-miniconda.sh
- conda create -n testing python=$PYVERSION --yes
- source activate testing
- make virtual-environment
- make -B virtual-environment

install:
- make install

script:
- python -c "import os, sys; assert os.environ['PYVERSION'] == sys.version[0]"
- conda list
- python -c "import os; print(os.environ['PYVERSION'])"
- python -c "import sys; print(sys.version)"
- python -c "import os, sys; assert os.environ['PYVERSION'] == '.'.join([sys.version[0], sys.version[2]])"
- make test
# silly problems are there for building docs in windows and py2 (tries to look for py3 jupyter kernel)
# only test docs once to make sure everything works on most recent python
- cd doc
- if [[ "${PYENV}" == "py37" && "${TRAVIS_OS_NAME}" != 'windows' ]]; then make html; fi
- cd ..
Expand Down
17 changes: 8 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.DEFAULT_GOAL := help

CI_DIR=./ci
CI_ENVIRONMENT_CONDA_DEFAULT_FILE=$(CI_DIR)/environment-conda-default.txt
CI_ENVIRONMENT_CONDA_FORGE_FILE=$(CI_DIR)/environment-conda-forge.txt


ifndef CONDA_PREFIX
$(error Conda not active, please install conda and then activate it using \`conda activate\`))
Expand All @@ -10,7 +14,6 @@ endif
VENV_DIR=$(CONDA_PREFIX)
endif


define PRINT_HELP_PYSCRIPT
import re, sys

Expand Down Expand Up @@ -80,17 +83,13 @@ docs: $(VENV_DIR) ## make the docs

.PHONY: virtual-environment
virtual-environment: $(VENV_DIR) ## make virtual environment for development

$(VENV_DIR): $(CI_ENVIRONMENT_CONDA_DEFAULT_FILE) $(CI_ENVIRONMENT_CONDA_FORGE_FILE)
# TODO: unify with ci install instructions somehow
$(CONDA_EXE) install --yes $(shell cat ci/environment-conda-default.txt | tr '\n' ' ')
$(CONDA_EXE) install --yes -c conda-forge $(shell cat ci/environment-conda-forge.txt | tr '\n' ' ')
# do matplotlib version fiddling for making plots
$(CONDA_EXE) uninstall --yes --force matplotlib
$(CONDA_EXE) install --yes $(shell cat $(CI_ENVIRONMENT_CONDA_DEFAULT_FILE) | tr '\n' ' ')
$(CONDA_EXE) install --yes -c conda-forge $(shell cat $(CI_ENVIRONMENT_CONDA_FORGE_FILE) | tr '\n' ' ')
# Install development setup
$(VENV_DIR)/bin/pip install -e .[tests,deploy]
# do matplotlib version fiddling for making plots (part 2)
$(VENV_DIR)/bin/pip uninstall -y matplotlib
$(VENV_DIR)/bin/pip install matplotlib==2.1.2
touch $(VENV_DIR)
# install docs requirements
cd doc; $(VENV_DIR)/bin/pip install -r requirements.txt

Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Next Release

- [#214](https://github.com/IAMconsortium/pyam/pull/214) Tidy up requirements specifications a little
- [#213](https://github.com/IAMconsortium/pyam/pull/213) Add support for IPCC colors, see the new tutorial "Using IPCC Color Palattes"
- [#212](https://github.com/IAMconsortium/pyam/pull/212) Now natively support reading R-style data frames with year columns like "X2015"
- [#202](https://github.com/IAMconsortium/pyam/pull/202) Extend the `df.rename()` function with a `check_duplicates (default True)` validation option
- [#201](https://github.com/IAMconsortium/pyam/pull/201) Added native support for legends outside of plots with `pyam.plotting.OUTSIDE_LEGEND` with a tutorial
Expand Down
19 changes: 12 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

environment:
matrix:
- PYTHON_VERSION: "2.7"
MINICONDA: "C:\\Miniconda-x64"
PYTHON_ARCH: "64"
- PYTHON_VERSION: "3.6"
MINICONDA: "C:\\Miniconda36-x64"
PYTHON_ARCH: "64"
- PYTHON_VERSION: "3.7"
MINICONDA: "C:\\Miniconda37-x64"
PYTHON_ARCH: "64"

init:
- "ECHO %PYTHON_VERSION% %MINICONDA%"
Expand All @@ -20,14 +20,19 @@ install:
- set "CONDA_ROOT=C:\Miniconda%BASE_PYTHON_VERSION%%ARCH_LABEL%"
- set "PATH=%CONDA_ROOT%;%CONDA_ROOT%\Scripts;%CONDA_ROOT%\Library\bin;%PATH%"

# Dependencies and package install
- conda install --yes geopandas cartopy
- if "%PYTHON_VERSION%" == "2.7" pip install functools32
# create conda environment
- conda update --yes conda
- conda create -n testing python="%PYTHON_VERSION%" --yes
- conda --version
- activate testing
- conda install -y numpy pandas pyyaml xlrd xlsxwriter matplotlib==3.0.3 seaborn==0.9.0 six requests jupyter nbconvert
- conda install -y -c conda-forge libiconv gdal fiona geopandas cartopy

build: false

test_script:
- pip install -e .[tests]
- conda list
- pip install -e .[tests,deploy]
- pytest -v --mpl tests --mpl-results-path=test-artifacts

artifacts:
Expand Down
17 changes: 11 additions & 6 deletions ci/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,23 @@ case "${TRAVIS_OS_NAME}" in
esac

case "${PYENV}" in
py27)
export PYVERSION=2
export CHOCOPATH='miniconda2'
export CHOCONAME='miniconda'
py35)
export PYVERSION=3.5
export CHOCOPATH='miniconda3'
export CHOCONAME='miniconda3'
;;
py36)
export PYVERSION=3.6
export CHOCOPATH='miniconda3'
export CHOCONAME='miniconda3'
;;
py37)
export PYVERSION=3
export PYVERSION=3.7
export CHOCOPATH='miniconda3'
export CHOCONAME='miniconda3'
;;
esac
export URL="https://repo.anaconda.com/miniconda/Miniconda$PYVERSION-latest-$OSNAME-x86_64.$EXT"
export URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-$OSNAME-x86_64.$EXT"

if [[ "$TRAVIS_OS_NAME" != 'windows' ]]; then
export PATH=$HOME/miniconda/bin:$PATH
Expand Down
8 changes: 4 additions & 4 deletions ci/environment-conda-default.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
numpy==1.14.0
pandas==0.22.0
numpy
pandas
pyyaml
xlrd
xlsxwriter
matplotlib==2.1.2
seaborn==0.8.1
matplotlib==3.0.3
seaborn==0.9.0
six
requests
jupyter
Expand Down
1 change: 1 addition & 0 deletions ci/environment-conda-forge.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
libiconv
gdal
fiona
geopandas
Expand Down
2 changes: 0 additions & 2 deletions ci/travis-install.sh → ci/travis-install-miniconda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ fi
# update conda
conda update --yes conda

# create named env
conda create -n testing python=$PYVERSION --yes
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ cloud_sptheme
nbformat
ipython
jupyter
jupyter_contrib_nbextensions
pillow
1 change: 1 addition & 0 deletions doc/source/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Tutorials
:maxdepth: 1

tutorials/pyam_first_steps.ipynb
tutorials/ipcc_colors.ipynb
tutorials/pyam_logo.ipynb
tutorials/iiasa_dbs.ipynb
tutorials/checking_databases.ipynb
Loading

0 comments on commit 3972e8c

Please sign in to comment.