Skip to content

Commit 0fe180e

Browse files
authored
Merge pull request #35 from andersy005/master
Code Refactoring : Allow CMIP integration
2 parents badcef2 + 87fa312 commit 0fe180e

35 files changed

+2467
-3289
lines changed

.circleci/config.yml

Lines changed: 56 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ workflows:
66
jobs:
77
- "python-3.7"
88
- "python-3.6"
9-
- "docs-and-linting"
9+
- "docs-build"
10+
- "test-linting"
11+
1012

11-
1213
jobs:
1314
"python-3.6":
1415
docker:
15-
- image: continuumio/miniconda:latest
16+
- image: conda/miniconda3:latest
1617

1718
environment:
1819
PYTHON: "3.6"
@@ -26,7 +27,7 @@ jobs:
2627
key: deps-{{ .Branch }}-3.6-{{ checksum "ci/environment-dev-3.6.yml" }}
2728

2829
- run: # install and activate conda environment
29-
name: configure conda
30+
name: Install conda environment
3031
command: ./ci/install-circle.sh
3132

3233
- run:
@@ -36,7 +37,7 @@ jobs:
3637
3738
3839
- run:
39-
name: Code Coverage
40+
name: Code Coverage
4041
command: |
4142
source activate ${ENV_NAME}
4243
@@ -57,14 +58,14 @@ jobs:
5758

5859
"python-3.7":
5960
docker:
60-
- image: continuumio/miniconda:latest
61+
- image: conda/miniconda3:latest
6162

6263
environment:
6364
PYTHON: "3.7"
6465
ENV_NAME: "intake-esm-dev"
6566

6667
steps:
67-
68+
6869
# Get our data and merge with upstream
6970
- checkout
7071

@@ -73,22 +74,22 @@ jobs:
7374
key: deps-{{ .Branch }}-3.7-{{ checksum "ci/environment-dev-3.7.yml" }}
7475

7576
- run: # install and activate conda environment
76-
name: configure conda
77+
name: Install conda environment
7778
command: ./ci/install-circle.sh
7879
- run:
7980
command: |
8081
source activate ${ENV_NAME}
8182
pytest --junitxml=test-reports/junit.xml --cov=./ --verbose
8283
8384
- run:
84-
name: Code Coverage
85+
name: Code Coverage
8586
command: |
8687
source activate ${ENV_NAME}
8788
8889
echo "[Upload coverage]"
8990
codecov
9091
91-
92+
9293
# Cache some files for a speedup in subsequent builds
9394
- save_cache:
9495
key: deps-{{ .Branch }}-3.7-{{ checksum "ci/environment-dev-3.7.yml" }}
@@ -101,19 +102,19 @@ jobs:
101102

102103
- store_artifacts:
103104
path: test-reports
104-
105-
106105

107-
"docs-and-linting":
106+
107+
108+
"test-linting":
108109
docker:
109-
- image: continuumio/miniconda:latest
110+
- image: conda/miniconda3:latest
110111

111112
environment:
112113
PYTHON: "3.7"
113114
ENV_NAME: "intake-esm-dev"
114115

115116
steps:
116-
117+
117118
# Get our data and merge with upstream
118119
- checkout
119120

@@ -122,32 +123,62 @@ jobs:
122123
key: deps-{{ .Branch }}-3.7-{{ checksum "ci/environment-dev-3.7.yml" }}
123124

124125
- run: # install and activate conda environment
125-
name: configure conda
126+
name: Install conda environment
126127
command: ./ci/install-circle.sh
127-
128+
128129

129130
- run:
130131
name: Code Styling with (black, flake8, isort)
131132
command: |
132133
source activate ${ENV_NAME}
133-
134+
134135
echo "[flake8]"
135-
flake8
136+
flake8
136137
137138
echo "[black]"
138-
black --check .
139+
black --check --line-length=100 -S --exclude='intake_esm/_version.py|versioneer.py' .
139140
140141
echo "[isort]"
141-
isort --recursive --check-only .
142+
isort --recursive -w 100 --check-only .
143+
144+
# Cache some files for a speedup in subsequent builds
145+
- save_cache:
146+
key: deps-{{ .Branch }}-3.7-{{ checksum "ci/environment-dev-3.7.yml" }}
147+
paths:
148+
- "/opt/conda/envs/${ENV_NAME}/"
149+
- "/opt/conda/pkgs"
150+
151+
152+
"docs-build":
153+
docker:
154+
- image: conda/miniconda3:latest
155+
156+
environment:
157+
PYTHON: "3.7"
158+
ENV_NAME: "intake-esm-dev"
159+
160+
steps:
161+
162+
# Get our data and merge with upstream
163+
- checkout
164+
165+
# Restore cached files to speed things up
166+
- restore_cache:
167+
key: deps-{{ .Branch }}-3.7-{{ checksum "ci/environment-dev-3.7.yml" }}
168+
169+
- run: # install and activate conda environment
170+
name: Install conda environment
171+
command: ./ci/install-circle.sh
172+
142173
- run:
143-
name: Check documentation build
174+
name: Check documentation build
144175
command: |
145176
source activate ${ENV_NAME}
146177
pushd docs
147178
make html
148179
popd
149180
150-
181+
151182
# Cache some files for a speedup in subsequent builds
152183
- save_cache:
153184
key: deps-{{ .Branch }}-3.7-{{ checksum "ci/environment-dev-3.7.yml" }}
@@ -156,6 +187,6 @@ jobs:
156187
- "/opt/conda/pkgs"
157188

158189
# Tell Circle to store the documentation output in a folder that we can access later
159-
- store_artifacts:
190+
- store_artifacts:
160191
path: docs/_build/html
161-
destination: html
192+
destination: html

.pre-commit-config.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
11
repos:
2+
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v2.1.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-docstring-first
9+
- id: check-json
10+
- id: check-added-large-files
11+
- id: check-yaml
12+
- id: double-quote-string-fixer
13+
214
- repo: https://github.com/ambv/black
315
rev: 18.9b0
416
hooks:
517
- id: black
6-
18+
args: ["--line-length", "100", "--skip-string-normalization",
19+
"--exclude", '''/(intake_esm/_version.py|versioneer.py)/''']
720

821
- repo: https://github.com/pre-commit/pre-commit-hooks
922
rev: v2.1.0
1023
hooks:
1124
- id: flake8
1225

1326
- repo: https://github.com/asottile/seed-isort-config
14-
rev: v1.5.0
27+
rev: v1.6.0
1528
hooks:
1629
- id: seed-isort-config
1730
- repo: https://github.com/pre-commit/mirrors-isort
1831
rev: v4.3.4
1932
hooks:
20-
- id: isort
33+
- id: isort
34+
args: ["line_length=100"]

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Intake-esm
2222
:alt: Conda Version
2323

2424

25-
Intake-esm provides a plug for reading esm Large Ensemble data sets using intake.
25+
Intake-esm provides a plugin for building and loading intake catalogs for earth system data sets holdings, such as CMIP and CESM Large Ensemble datasets.
2626
See documentation_ for more information.
2727

2828
.. _documentation: https://intake-esm.readthedocs.io/en/latest/

ci/environment-dev-3.6.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ dependencies:
2020
- pyyaml
2121
- tqdm
2222
- xarray
23-
- pip=18.1
23+
- pip

ci/environment-dev-3.7.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies:
3030
- sphinx>=1.6
3131
- tqdm
3232
- xarray
33-
- pip=18.1
33+
- pip
3434
- make
3535
- pip:
3636
- sphinx_copybutton

ci/install-circle.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set -e
44
set -eo pipefail
55

66
conda config --set always_yes true --set changeps1 false --set quiet true
7-
conda update -q conda
87
conda config --add channels conda-forge
98
conda env create -f ci/environment-dev-${PYTHON}.yml --name=${ENV_NAME} --quiet
109
conda env list

docs/source/api.rst

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,14 @@ This is a reference API class listing, and modules.
66
.. currentmodule:: intake_esm
77

88
.. autosummary::
9-
core.CesmMetadataStoreCatalog
10-
core.CesmSource
11-
manage_collections.StorageResource
12-
manage_collections.CESMCollections
13-
9+
core.ESMMetadataStoreCatalog
1410

15-
.. currentmodule:: intake_esm.core
16-
17-
.. autoclass:: CesmMetadataStoreCatalog
18-
:members: __init__, search
19-
20-
.. autoclass:: CesmSource
21-
:members: __init__, to_xarray
2211

12+
.. currentmodule:: intake_esm.core
2313

24-
.. currentmodule:: intake_esm.manage_collections
14+
.. autoclass:: ESMMetadataStoreCatalog
15+
:members: __init__, search, build_collections, open_collection, get_built_collections
2516

26-
.. autoclass:: StorageResource
27-
:members: __init__
2817

29-
.. autoclass:: CESMCollections
30-
:members: __init__, get_built_collection
3118

3219

0 commit comments

Comments
 (0)