Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #23 from andersy005/esmlab
Browse files Browse the repository at this point in the history
Code Refactoring for newer version
  • Loading branch information
andersy005 authored Jan 4, 2019
2 parents b8c2cef + 14a7911 commit 09cef9c
Show file tree
Hide file tree
Showing 14 changed files with 182 additions and 234 deletions.
96 changes: 42 additions & 54 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,8 @@ workflows:
jobs:
- "python-2.7"
- "python-3.6"
- "deploy-pypi":
requires:
- "python-2.7"
- "python-3.6"
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/

- "deploy-conda":
requires:
- "python-2.7"
- "python-3.6"
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- "python-3.7"


jobs:
# Python 2.7 build
"python-2.7":
Expand Down Expand Up @@ -82,6 +63,45 @@ jobs:
- restore_cache:
key: deps-{{ .Branch }}-3.6-{{ checksum "ci/environment-dev-3.6.yml" }}

- run: # install and activate conda environment
name: configure conda
command: ./ci/install-circle.sh
- run:
command: |
source activate ${ENV_NAME}
pytest --junitxml=test-reports/junit.xml --cov=./
# Cache some files for a speedup in subsequent builds
- save_cache:
key: deps-{{ .Branch }}-3.6-{{ checksum "ci/environment-dev-3.6.yml" }}
paths:
- "/opt/conda/envs/${ENV_NAME}/"
- "/opt/conda/pkgs"

- store_test_results:
path: test-reports

- store_artifacts:
path: test-reports


"python-3.7":
docker:
- image: continuumio/miniconda:latest

environment:
PYTHON: "3.7"
ENV_NAME: "esmlab-dev"

steps:

# Get our data and merge with upstream
- checkout

# Restore cached files to speed things up
- restore_cache:
key: deps-{{ .Branch }}-3.7-{{ checksum "ci/environment-dev-3.7.yml" }}

- run: # install and activate conda environment
name: configure conda
command: ./ci/install-circle.sh
Expand Down Expand Up @@ -117,7 +137,7 @@ jobs:
# Cache some files for a speedup in subsequent builds
- save_cache:
key: deps-{{ .Branch }}-3.6-{{ checksum "ci/environment-dev-3.6.yml" }}
key: deps-{{ .Branch }}-3.7-{{ checksum "ci/environment-dev-3.7.yml" }}
paths:
- "/opt/conda/envs/${ENV_NAME}/"
- "/opt/conda/pkgs"
Expand All @@ -130,36 +150,4 @@ jobs:
# Tell Circle to store the documentation output in a folder that we can access later
- store_artifacts:
path: docs/_build/html
destination: html

"deploy-pypi":
# This is the base environment that Circle will use
docker:
- image: continuumio/miniconda:latest

steps:
# Get our data and merge with upstream
- checkout

- run:
name: Building and Deploying PyPI package
command: |
python setup.py sdist
pip wheel . -w dist

"deploy-conda":
docker:
- image: continuumio/miniconda:latest

steps:
# Get our data and merge with upstream
- checkout

- run:
name: Deploy package release to Anaconda.org
command: |
conda install conda-build anaconda-client --yes --quiet
./ci/upload-anaconda.sh
destination: html
10 changes: 10 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
recursive-include esmlab *.py

include LICENSE
include README.rst
include requirements.txt

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
include versioneer.py
include esmlab/_version.py
11 changes: 10 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Esmlab (Earth System Model Lab)
================================

.. image:: https://img.shields.io/circleci/project/github/NCAR/esmlab/master.svg?style=for-the-badge
.. image:: https://img.shields.io/circleci/project/github/NCAR/esmlab/master.svg?style=for-the-badge&logo=circleci
:target: https://circleci.com/gh/NCAR/esmlab/tree/master

.. image:: https://img.shields.io/codecov/c/github/NCAR/esmlab.svg?style=for-the-badge
Expand All @@ -12,6 +12,15 @@ Esmlab (Earth System Model Lab)
:target: https://esmlab.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://img.shields.io/pypi/v/esmlab.svg?style=for-the-badge
:target: https://pypi.org/project/esmlab
:alt: Python Package Index

.. image:: https://img.shields.io/conda/vn/conda-forge/esmlab.svg?style=for-the-badge
:target: https://anaconda.org/conda-forge/esmlab
:alt: Conda Version



Tools for working with earth system multi-model analyses with xarray. See
documentation_ for more information.
Expand Down
14 changes: 2 additions & 12 deletions ci/environment-dev-2.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,10 @@ dependencies:
- zarr
- dask
- distributed
- autopep8
- flake8
- pytest
- coverage
- pytest-cov
- codecov
- sphinx>=1.6
- sphinx_rtd_theme
- recommonmark
- numpydoc
- nbsphinx
- pandoc
- ipykernel
- six
- pip:
- sphinx_copybutton



17 changes: 1 addition & 16 deletions ci/environment-dev-3.6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,7 @@ dependencies:
- zarr
- dask
- distributed
- autopep8
- flake8
- black
- isort
- pytest
- coverage
- pytest-cov
- codecov
- sphinx>=1.6
- sphinx_rtd_theme
- recommonmark
- numpydoc
- nbsphinx
- pandoc
- ipykernel
- six
- pip:
- sphinx_copybutton

- codecov
31 changes: 31 additions & 0 deletions ci/environment-dev-3.7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: esmlab-dev
channels:
- conda-forge
dependencies:
- python=3.7
- numpy
- xarray
- matplotlib
- netcdf4
- zarr
- dask
- distributed
- autopep8
- flake8
- black
- isort
- pytest
- coverage
- pytest-cov
- codecov
- sphinx>=1.6
- sphinx_rtd_theme
- recommonmark
- numpydoc
- nbsphinx
- pandoc
- ipykernel
- six
- pip:
- sphinx_copybutton

17 changes: 0 additions & 17 deletions ci/upload-anaconda.sh

This file was deleted.

52 changes: 0 additions & 52 deletions conda/meta.yaml

This file was deleted.

37 changes: 28 additions & 9 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,41 @@ API reference
=============


Statistics functions
"""""""""""""""""""""

.. currentmodule:: esmlab

Statistics functions
~~~~~~~~~~~~~~~~~~~~~~~

.. autosummary::
statistics.weighted_sum
statistics.weighted_mean
statistics.weighted_std
statistics.weighted_rmsd
statistics.weighted_cov
statistics.weighted_corr

Climatogy functions
~~~~~~~~~~~~~~~~~~~~~~~

.. autosummary::
climatology.compute_mon_climatology
climatology.compute_mon_anomaly
climatology.compute_ann_climatology


.. currentmodule:: esmlab.statistics

.. autofunction:: weighted_sum
.. autofunction:: weighted_mean
.. autofunction:: weighted_std
.. autofunction:: weighted_rmsd
.. autofunction:: weighted_cov
.. autofunction:: weighted_corr

.. currentmodule:: esmlab.climatology

.. autofunction:: compute_mon_climatology
.. autofunction:: compute_mon_anomaly
.. autofunction:: compute_ann_climatology


.. autofunction:: esmlab.statistics.weighted_sum
.. autofunction:: esmlab.statistics.weighted_mean
.. autofunction:: esmlab.statistics.weighted_std
.. autofunction:: esmlab.statistics.weighted_rmsd
.. autofunction:: esmlab.statistics.weighted_cov
.. autofunction:: esmlab.statistics.weighted_corr
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:maxdepth: 2
:caption: Contents:

installation
install
api
develop
changelog
Expand Down
Loading

0 comments on commit 09cef9c

Please sign in to comment.