Skip to content

Commit

Permalink
Merge branch 'master' into 534_pjg_mfw_extremes
Browse files Browse the repository at this point in the history
  • Loading branch information
doutriaux1 committed Jun 21, 2019
2 parents 6094087 + 6d29f6b commit c289b48
Show file tree
Hide file tree
Showing 161 changed files with 29,828 additions and 4,977 deletions.
218 changes: 218 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
version: 2

checkout:
post:
- ./ci-support/checkout_merge_commit.sh

aliases:

- &setup_miniconda
name: setup_miniconda
command: |
mkdir -p workspace
git clone -b validateNightly [email protected]:CDAT/cdat workspace/cdat --depth=1
python workspace/cdat/scripts/install_miniconda.py -w $WORKDIR -p 'py3.6'
- &create_conda_env
name: create_conda_env
environment:
PKGS: "vcs vcsaddons mesalib matplotlib scipy cia testsrunner 'proj4<5' 'vtk-cdat>8.1' libnetcdf=4.6.2"
CHANNELS: "-c cdat/label/nightly -c conda-forge -c pcmdi"
command: |
if [ -d ${HOME}/miniconda ]; then
export PATH=$HOME/miniconda/bin:$PATH
echo "Found miniconda directory"
else
mkdir -p workspace
git clone -b validateNightly [email protected]:CDAT/cdat workspace/cdat --depth=1
python workspace/cdat/scripts/install_miniconda.py -w ${HOME} -p 'py3.7'
echo "miniconda directory not found, installing conda"
export PATH=${HOME}/miniconda/bin:$PATH
conda config --set always_yes yes --set changeps1 no
conda update -y -q conda
conda config --set anaconda_upload no
if [[ $PY_VER = "py2" ]]; then
conda create -q -n cdat $CHANNELS "python<3" $PKGS $FFMPEG
else
conda create -q -n cdat $CHANNELS "python=3.7" $PKGS $FFMPEG $COVERAGE_PKGS
fi
fi
- &setup_pmp
name: setup_pmp
command: |
export PATH=${HOME}/miniconda/bin:$PATH
source activate cdat
python setup.py install
- &run_pmp_tests
name: run_pmp_tests
command: |
export PATH=${HOME}/miniconda/bin:$PATH
export CDAT_ANONYMOUS_LOG=False
export CDAT_SETUP_PATH=${HOME}
source activate cdat
python run_tests.py -H -v2 $COVERAGE
RESULT=$?
echo "*** $PY_VER test result: ${RESULT}"
- &run_coveralls
name: run_coveralls
command: |
export PATH=${HOME}/miniconda/bin:$PATH
source activate cdat
coveralls
source deactivate
- &conda_upload
name: conda_upload
environment:
CHANNELS: "-c cdat/label/nightly -c conda-forge -c pcmdi"
PKG_NAME: "pcmdi_metrics"
LABEL: "nightly"
command: |
if [[ $CIRCLE_BRANCH != 'master' ]]; then
exit 0
fi
export PATH=${HOME}/miniconda/bin:$PATH
mkdir conda-bld
cd conda-bld
conda install conda-build anaconda-client
conda config --set anaconda_upload no
export CONDA_BLD_PATH=`pwd`/build_conda
mkdir build_conda
git clone git:https://github.com/cdat/conda-recipes
cd conda-recipes
rm -rf cdp
cp -r ../../recipes/pcmdi_metrics .
python ./prep_for_build.py -l 1.2
conda build $PKG_NAME $CHANNELS --python=37
conda build $PKG_NAME $CHANNELS --python=27
anaconda -t $CONDA_UPLOAD_TOKEN upload -u pcmdi -l $LABEL $CONDA_BLD_PATH/noarch/$PKG_NAME-*tar.bz2 --force
jobs:
macos_pmp_py2:
macos:
xcode: "9.2.0"
environment:
WORKDIR: "test_macos_pmp_py2"
OS: "osx-64"
PY_VER: "py2"
FFMPEG: "'ffmpeg>4' 'libpng>1.6.34'"
steps:
- checkout
- restore_cache:
keys:
- macos_py2_2019-06-01
- run: *create_conda_env
- save_cache:
key: macos_py2_2019-06-01
paths: /Users/distiller/miniconda
- run: *setup_pmp
- run: *run_pmp_tests
- store_artifacts:
path: tests_html
destination: tests_html
- store_artifacts:
path: tests_png
destination: tests_png

macos_pmp_py3:
macos:
xcode: "9.2.0"
environment:
WORKDIR: "test_macos_pmp_py3"
OS: "osx-64"
PY_VER: "py3"
FFMPEG: "'ffmpeg>4' 'libpng>1.6.34'"
COVERAGE: "-c tests/coverage.json --coverage-from-egg"
COVERAGE_PKGS: "coverage coveralls"
steps:
- checkout
- restore_cache:
keys:
- macos_py3_2019-06-01
- run: *create_conda_env
- save_cache:
key: macos_py3_2019-06-01
paths: /Users/distiller/miniconda
- run: *setup_pmp
- run: *run_pmp_tests
- run: *run_coveralls
- store_artifacts:
path: tests_html
destination: tests_html
- store_artifacts:
path: tests_png
destination: tests_png

linux_pmp_py2:
machine:
image: circleci/classic:latest
environment:
WORKDIR: "test_linux_pmp_py2"
OS: "linux-64"
PY_VER: "py2"
FFMPEG: "ffmpeg"
steps:
- checkout
- restore_cache:
keys:
- linux_py2_2019-06-01
- run: *create_conda_env
- save_cache:
key: linux_py2_2019-06-01
paths: /home/circleci/miniconda
- run: *setup_pmp
- run: *run_pmp_tests
- store_artifacts:
path: tests_html
destination: tests_html
- store_artifacts:
path: tests_png
destination: tests_png

linux_pmp_py3:
machine:
image: circleci/classic:latest
environment:
WORKDIR: "test_linux_pmp_py3"
OS: "linux-64"
PY_VER: "py3"
FFMPEG: "ffmpeg"
COVERAGE: "-c tests/coverage.json --coverage-from-egg"
COVERAGE_PKGS: "coverage coveralls"
steps:
- checkout
- restore_cache:
keys:
- linux_py3_2019-06-01
- run: *create_conda_env
- save_cache:
key: linux_py3_2019-06-01
paths: /home/circleci/miniconda
- run: *setup_pmp
- run: *run_pmp_tests
- run: *conda_upload
- run: *run_coveralls
- store_artifacts:
path: tests_html
destination: tests_html
- store_artifacts:
path: tests_png
destination: tests_png


workflows:
version: 2
pcmdi_metrics:
jobs:
- macos_pmp_py2
- macos_pmp_py3:
requires:
- macos_pmp_py2
- linux_pmp_py2
- linux_pmp_py3:
requires:
- linux_pmp_py2
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
<img src="share/pcmdi/PMPLogo_1359x1146px_300dpi.png" width="15%" height="15%" align="right" />
<h5 align="right"></h5>

PCMDI metrics package (PMP)
======
[![stable version](https://img.shields.io/badge/stable%20version-1.1.2-brightgreen.svg)](https://github.com/PCMDI/pcmdi_metrics/releases/tag/1.1.2)
![repo size](https://reposs.herokuapp.com/?path=PCMDI/pcmdi_metrics)
[![stable version](https://img.shields.io/badge/stable%20version-1.2-brightgreen.svg)](https://github.com/PCMDI/pcmdi_metrics/releases/tag/1.2)
![platforms](https://img.shields.io/badge/platforms-linux%20|%20osx-lightgrey.svg)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.809463.svg)](https://doi.org/10.5281/zenodo.809463)
[![Anaconda-Server Badge](https://anaconda.org/pcmdi/pcmdi_metrics/badges/installer/conda.svg)](https://conda.anaconda.org/pcmdi)
[![Anaconda-Server Badge](https://anaconda.org/pcmdi/pcmdi_metrics/badges/downloads.svg)](https://anaconda.org/pcmdi/pcmdi_metrics)

[![CircleCI](https://circleci.com/gh/PCMDI/pcmdi_metrics.svg?style=svg)](https://circleci.com/gh/PCMDI/pcmdi_metrics)
[![Coverage Status](https://coveralls.io/repos/github/PCMDI/pcmdi_metrics/badge.svg)](https://coveralls.io/github/PCMDI/pcmdi_metrics)

The PCMDI metrics package is used to objectively compare results from climate models with observations using well-established statistical tests. Results are produced in the context of all model simulations contributed to CMIP5 and earlier CMIP phases. Among other purposes, this enables modeling groups to evaluate changes during the development cycle in the context of the structural error distribution of the multi-model ensemble. Currently, the comparisons emphasize large- to global-scale annual cycle performance metrics. Current work in v1.x development branches include established statistics for ENSO, regional monsoon precipitation, and the diurnal cycle of precipitation. These diagnostics will be included in a future PMP release.

The metrics package consists of four parts: 1) Analysis software, 2) an observationally-based database of global (or near global, land or ocean) annual cycle climatologies, 3) a database of performance metrics computed for CMIP models and 4) package documentation.
The package expects model data to be [CF-compliant](http:https://cfconventions.org/). To successfully use the package some input data "conditioning" may be required. We provide several demo scripts within the package to facilitate new users.

**Users of the current release (v1.1.2) will need to contact the PMP developers ([email protected]) to obtain supporting datasets and get started using the package.**
**Users of the current release (v1.2) will need to contact the PMP developers ([email protected]) to obtain supporting datasets and get started using the package.**


GETTING STARTED
----------------

Installation requirements and instructions are available on the [Install](https://github.com/PCMDI/pcmdi_metrics/wiki/Install) page
Installation requirements and instructions are available on the [Install](https://github.com/PCMDI/pcmdi_metrics/wiki/Install-using-Anaconda) page

An overview for using the package and template scripts are detailed on the [Using-the-package](https://github.com/PCMDI/pcmdi_metrics/wiki/Using-the-package) page

Some installation support for CMIP participating modeling groups is available: [email protected]


PMP versions
------------

v1.0 - Prototype version of the PMP
v1.2 - Tied to CDAT 8.0. Now includes extensive regression testing. New metrics: Diurnal cycle and intermittency of precipitation, Sperber and Wang Monsoon metrics

v1.1.2 - Now managed through Anaconda, and tied to UV-CDAT 2.10. Weights on bias statistic added. Extensive provenance information incorporated into json files.

v1.1 - First public release, emphasizing climatological statistics, with development branches for ENSO and regional monsoon precipitation indices

v1.1.2 - Now managed through Anaconda, and tied to UV-CDAT 2.10. Weights on bias statistic added. Extensive provenance information incorporated into json files.
v1.0 - Prototype version of the PMP

29 changes: 29 additions & 0 deletions ci-support/checkout_merge_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash


# Add `master` branch to the update list.
# Otherwise CircleCI will give us a cached one.
FETCH_REFS="+master:master"

# Update PR refs for testing.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/head:pr/${CIRCLE_PR_NUMBER}/head"
FETCH_REFS="${FETCH_REFS} +refs/pull/${CIRCLE_PR_NUMBER}/merge:pr/${CIRCLE_PR_NUMBER}/merge"
fi

# Retrieve the refs.
git fetch -u origin ${FETCH_REFS}

# Checkout the PR merge ref.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
git checkout -qf "pr/${CIRCLE_PR_NUMBER}/merge"
fi

# Check for merge conflicts.
if [[ -n "${CIRCLE_PR_NUMBER}" ]]
then
git branch --merged | grep master > /dev/null
git branch --merged | grep "pr/${CIRCLE_PR_NUMBER}/head" > /dev/null
fi
Loading

0 comments on commit c289b48

Please sign in to comment.