Skip to content

Commit badcef2

Browse files
authored
Merge pull request #34 from andersy005/rename-package
Rename package
2 parents cf785a7 + c6ec1f6 commit badcef2

30 files changed

+121
-232
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
environment:
1818
PYTHON: "3.6"
19-
ENV_NAME: "intake-cesm-dev"
19+
ENV_NAME: "intake-esm-dev"
2020

2121
steps:
2222
- checkout
@@ -61,7 +61,7 @@ jobs:
6161

6262
environment:
6363
PYTHON: "3.7"
64-
ENV_NAME: "intake-cesm-dev"
64+
ENV_NAME: "intake-esm-dev"
6565

6666
steps:
6767

@@ -110,7 +110,7 @@ jobs:
110110

111111
environment:
112112
PYTHON: "3.7"
113-
ENV_NAME: "intake-cesm-dev"
113+
ENV_NAME: "intake-esm-dev"
114114

115115
steps:
116116

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[run]
22
omit =
33
tests/*.py
4-
intake_cesm/_version.py
4+
intake_esm/_version.py
55
versioneer.py
66
setup.py

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
Thanks for submitting a PR, your contribution is really appreciated!
22

3-
Here's a quick checklist that should be present in PRs (you can delete this text from the final description, this is
4-
just a guideline):
3+
Here's a quick checklist that should be present in PRs (you can delete this text from the final description, this is just a guideline):
54

6-
- [ ] Create a new changelog file in the `changelog` folder, with a name like `<ISSUE NUMBER>.<TYPE>.rst`. See [CHANGELOG.rst](https://github.com/NCAR/intake-cesm/blob/master/CHANGELOG.rst) for details.
75
- [ ] Include documentation when adding new features.
86
- [ ] Include new tests or update existing tests when applicable.

CONTRIBUTING.rst

Lines changed: 31 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
============================
2-
Contribution getting started
2+
Contributing to intake-esm
33
============================
44

55
Contributions are highly welcomed and appreciated. Every little help counts,
@@ -14,10 +14,10 @@ so do not hesitate!
1414
Feature requests and feedback
1515
-----------------------------
1616

17-
Do you like intake-cesm? Share some love on Twitter or in your blog posts!
17+
Do you like intake-esm? Share some love on Twitter or in your blog posts!
1818

1919
We'd also like to hear about your propositions and suggestions. Feel free to
20-
`submit them as issues <https://github.com/NCAR/intake-cesm>`_ and:
20+
`submit them as issues <https://github.com/NCAR/intake-esm>`_ and:
2121

2222
* Explain in detail how they should work.
2323
* Keep the scope as narrow as possible. This will make it easier to implement.
@@ -28,13 +28,13 @@ We'd also like to hear about your propositions and suggestions. Feel free to
2828
Report bugs
2929
-----------
3030

31-
Report bugs for intake-cesm in the `issue tracker <https://github.com/NCAR/intake-cesm>`_.
31+
Report bugs for intake-esm in the `issue tracker <https://github.com/NCAR/intake-esm>`_.
3232

3333
If you are reporting a bug, please include:
3434

3535
* Your operating system name and version.
3636
* Any details about your local setup that might be helpful in troubleshooting,
37-
specifically the Python interpreter version, installed libraries, and intake-cesm
37+
specifically the Python interpreter version, installed libraries, and intake-esm
3838
version.
3939
* Detailed steps to reproduce the bug.
4040

@@ -48,15 +48,15 @@ fix the bug itself.
4848
Fix bugs
4949
--------
5050

51-
Look through the `GitHub issues for bugs <https://github.com/NCAR/intake-cesm/labels/type:%20bug>`_.
51+
Look through the `GitHub issues for bugs <https://github.com/NCAR/intake-esm/labels/type:%20bug>`_.
5252

5353
Talk to developers to find out how you can fix specific bugs.
5454

5555

5656
Write documentation
5757
-------------------
5858

59-
intake-cesm could always use more documentation. What exactly is needed?
59+
intake-esm could always use more documentation. What exactly is needed?
6060

6161
* More complementary documentation. Have you perhaps found something unclear?
6262
* Docstrings. There can never be too many of them.
@@ -69,11 +69,14 @@ without using a local copy. This can be convenient for small fixes.
6969
Build the documentation locally with the following command:
7070

7171
.. code:: bash
72-
73-
$ tox -e docs
72+
73+
$ conda env update -f ci/environment-dev-3.7.yml
74+
$ cd docs
75+
$ make html
7476
7577
The built documentation should be available in the ``docs/_build/``.
7678

79+
7780

7881
.. _`pull requests`:
7982
.. _pull-requests:
@@ -83,22 +86,21 @@ Preparing Pull Requests
8386

8487

8588
#. Fork the
86-
`intake-cesm GitHub repository <https://github.com/NCAR/intake-cesm>`__. It's
87-
fine to use ``intake-cesm`` as your fork repository name because it will live
89+
`intake-esm GitHub repository <https://github.com/NCAR/intake-esm>`__. It's
90+
fine to use ``intake-esm`` as your fork repository name because it will live
8891
under your user.
8992

9093
#. Clone your fork locally using `git <https://git-scm.com/>`_ and create a branch::
9194

92-
$ git clone [email protected]:YOUR_GITHUB_USERNAME/intake-cesm.git
93-
$ cd intake-cesm
95+
$ git clone [email protected]:YOUR_GITHUB_USERNAME/intake-esm.git
96+
$ cd intake-esm
97+
9498
# now, to fix a bug or add feature create your own branch off "master":
9599

96-
$ git checkout -b your-bugfix-feature-branch-name master
100+
$ git checkout -b your-bugfix-feature-branch-name master
97101

98-
If you need some help with Git, follow this quick start
99-
guide: https://git.wiki.kernel.org/index.php/QuickStart
100102

101-
#. Install `pre-commit <https://pre-commit.com>`_ and its hook on the intake-cesm repo::
103+
#. Install `pre-commit <https://pre-commit.com>`_ and its hook on the intake-esm repo::
102104

103105
$ pip install --user pre-commit
104106
$ pre-commit install
@@ -107,24 +109,20 @@ Preparing Pull Requests
107109

108110
https://pre-commit.com/ is a framework for managing and maintaining multi-language pre-commit hooks
109111
to ensure code-style and code formatting is consistent.
112+
#. Install dependencies into a new conda environment::
110113

111-
#. Install tox
112-
113-
Tox is used to run all the tests and will automatically setup virtualenvs
114-
to run the tests in.
115-
(will implicitly use http://www.virtualenv.org/en/latest/)::
116-
117-
$ pip install tox
114+
$ conda env update -f ci/environment-dev-3.7.yml
118115

116+
119117
#. Run all the tests
120118

121-
You need to have Python 3.6 and 3.7 available in your system. Now
122-
running tests is as simple as issuing this command::
119+
Now running tests is as simple as issuing this command::
120+
121+
$ conda activate intake-esm-dev
122+
$ pytest --junitxml=test-reports/junit.xml --cov=./ --verbose
123123

124-
$ tox -e linting,py36,py37
125124

126-
This command will run tests via the "tox" tool against Python 3.6 and 3.7
127-
and also perform "lint" coding-style checks.
125+
This command will run tests via the "pytest" tool against Python 3.7.
128126

129127
#. You can now edit your local working copy and run the tests again as necessary. Please follow PEP-8 for naming.
130128

@@ -135,16 +133,12 @@ Preparing Pull Requests
135133
$ git commit -a -m "<commit message>"
136134
$ git push -u
137135

138-
#. Create a new changelog entry in ``changelog``. The file should be named ``<issueid>.<type>``,
139-
where *issueid* is the number of the issue related to the change and *type* is one of
140-
``bugfix``, ``removal``, ``feature``, ``vendor``, ``doc`` or ``trivial``.
141-
142-
#. Add yourself to ``AUTHORS`` file if not there yet, in alphabetical order.
143136

144137
#. Finally, submit a pull request through the GitHub website using this data::
145138

146-
head-fork: YOUR_GITHUB_USERNAME/intake-cesm
139+
head-fork: YOUR_GITHUB_USERNAME/intake-esm
147140
compare: your-branch-name
148141

149-
base-fork: NCAR/intake-cesm
150-
base: master # if it's a bugfix or feature
142+
base-fork: NCAR/intake-esm
143+
base: master
144+

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ include README.rst
55
include requirements.txt
66

77
recursive-include example_input
8-
recursive-include intake_cesm *.py
8+
recursive-include intake_esm *.py
99
recursive-exclude * __pycache__
1010
recursive-exclude * *.py[co]
1111
include versioneer.py
12-
include intake_cesm/_version.py
12+
include intake_esm/_version.py

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ clean-pyc:
2424
find . -name '*~' -exec rm -f {} +
2525

2626
lint:
27-
flake8 intake_cesm test
27+
flake8 intake_esm test
2828

2929
test:
3030
py.test
@@ -33,15 +33,15 @@ test-all:
3333
tox
3434

3535
coverage:
36-
coverage run --source intake_cesm setup.py test
36+
coverage run --source intake_esm setup.py test
3737
coverage report -m
3838
coverage html
3939
open htmlcov/index.html
4040

4141
docs:
42-
rm -f docs/intake_cesm.rst
42+
rm -f docs/intake_esm.rst
4343
rm -f docs/modules.rst
44-
sphinx-apidoc -o docs/ intake_cesm
44+
sphinx-apidoc -o docs/ intake_esm
4545
$(MAKE) -C docs clean
4646
$(MAKE) -C docs html
4747
open docs/_build/html/index.html

README.rst

Lines changed: 13 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,123 +1,28 @@
11
===============================
2-
Intake-cesm
2+
Intake-esm
33
===============================
44

5-
.. image:: https://img.shields.io/circleci/project/github/NCAR/intake-cesm/master.svg?style=for-the-badge&logo=circleci
6-
:target: https://circleci.com/gh/NCAR/intake-cesm/tree/master
5+
.. image:: https://img.shields.io/circleci/project/github/NCAR/intake-esm/master.svg?style=for-the-badge&logo=circleci
6+
:target: https://circleci.com/gh/NCAR/intake-esm/tree/master
77

8-
.. image:: https://img.shields.io/codecov/c/github/NCAR/intake-cesm.svg?style=for-the-badge
9-
:target: https://codecov.io/gh/NCAR/intake-cesm
8+
.. image:: https://img.shields.io/codecov/c/github/NCAR/intake-esm.svg?style=for-the-badge
9+
:target: https://codecov.io/gh/NCAR/intake-esm
1010

1111

12-
.. image:: https://img.shields.io/readthedocs/intake-cesm/latest.svg?style=for-the-badge
13-
:target: https://intake-cesm.readthedocs.io/en/latest/?badge=latest
12+
.. image:: https://img.shields.io/readthedocs/intake-esm/latest.svg?style=for-the-badge
13+
:target: https://intake-esm.readthedocs.io/en/latest/?badge=latest
1414
:alt: Documentation Status
1515

16-
.. image:: https://img.shields.io/pypi/v/intake-cesm.svg?style=for-the-badge
17-
:target: https://pypi.org/project/intake-cesm
16+
.. image:: https://img.shields.io/pypi/v/intake-esm.svg?style=for-the-badge
17+
:target: https://pypi.org/project/intake-esm
1818
:alt: Python Package Index
1919

20-
.. image:: https://img.shields.io/conda/vn/conda-forge/intake-cesm.svg?style=for-the-badge
21-
:target: https://anaconda.org/conda-forge/intake-cesm
20+
.. image:: https://img.shields.io/conda/vn/conda-forge/intake-esm.svg?style=for-the-badge
21+
:target: https://anaconda.org/conda-forge/intake-esm
2222
:alt: Conda Version
2323

2424

25-
Intake-cesm provides a plug for reading CESM Large Ensemble data sets using intake.
25+
Intake-esm provides a plug for reading esm Large Ensemble data sets using intake.
2626
See documentation_ for more information.
2727

28-
.. _documentation: https://intake-cesm.readthedocs.io/en/latest/
29-
30-
31-
An example of using intake-cesm:
32-
33-
.. code-block:: python
34-
35-
>>> import intake
36-
>>> 'cesm_metadatastore' in intake.registry
37-
True
38-
>>> from intake_cesm.config import set_options
39-
>>> set_options(database_directory="./tests/test_collections")
40-
<intake_cesm.config.set_options object at 0x10349efd0>
41-
42-
>>> build_args = {"collection_input_file" : "./tests/collection_input_test.yml", "collection_type_def_file" : "intake_cesm/cesm_definitions.yml",
43-
... "overwrite_existing" : True}
44-
>>> col = intake.open_cesm_metadatastore(collection="cesm_dple_test_collection", build_args=build_args)
45-
INFO:root:Active collection : cesm_dple_test_collection
46-
INFO:root:Active database: /Users/abanihi/devel/ncar/intake-cesm/tests/test_collections/cesm_dple_test_collection.csv
47-
INFO:root:calling build
48-
INFO:root:working on experiment: g.e11_LENS.GECOIAF.T62_g16.009
49-
INFO:root:getting file listing: TEST-LIST:input-file:tests/intake-cesm-test-filelist
50-
INFO:root:building file database: TEST-LIST:input-file:tests/intake-cesm-test-filelist
51-
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12052.60it/s]
52-
1it [00:00, 112.32it/s]
53-
INFO:root:working on experiment: g.e11_LENS.GECOIAF.T62_g16.009-copy
54-
INFO:root:getting file listing: SAMPLE-DATA:posix:tests/sample_data
55-
INFO:root:building file database: SAMPLE-DATA:posix:tests/sample_data
56-
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 23215.70it/s]
57-
1it [00:00, 71.65it/s]
58-
Active collection: cesm_dple_test_collection
59-
>>> col.df
60-
resource resource_type direct_access ... sequence_order has_ocean_bgc grid
61-
0 SAMPLE-DATA:posix:tests/sample_data posix True ... 0 NaN POP_gx1v6
62-
1 SAMPLE-DATA:posix:tests/sample_data posix True ... 0 NaN POP_gx1v6
63-
2 SAMPLE-DATA:posix:tests/sample_data posix True ... 0 NaN POP_gx1v6
64-
3 TEST-LIST:input-file:tests/intake-cesm-test-fi... input-file False ... 0 NaN POP_gx1v6
65-
4 TEST-LIST:input-file:tests/intake-cesm-test-fi... input-file False ... 0 NaN POP_gx1v6
66-
5 TEST-LIST:input-file:tests/intake-cesm-test-fi... input-file False ... 0 NaN POP_gx1v6
67-
68-
[6 rows x 18 columns]
69-
>>> cat = col.search(variable='O2', direct_access=True)
70-
>>> print(cat.yaml(True))
71-
plugins:
72-
source:
73-
- module: intake_cesm.core
74-
sources:
75-
cesm_dple_test_collection-26a47333-f124-4b88-a235-020a731c2509:
76-
args:
77-
chunks:
78-
time: 1
79-
collection: cesm_dple_test_collection
80-
concat_dim: time
81-
decode_coords: false
82-
decode_times: false
83-
engine: netcdf4
84-
query:
85-
case: null
86-
component: null
87-
ctrl_branch_year: null
88-
date_range: null
89-
direct_access: true
90-
ensemble: null
91-
experiment: null
92-
files: null
93-
files_basename: null
94-
files_dirname: null
95-
grid: null
96-
has_ocean_bgc: null
97-
resource: null
98-
resource_type: null
99-
sequence_order: null
100-
stream: null
101-
variable: O2
102-
year_offset: null
103-
description: Catalog from cesm_dple_test_collection collection
104-
driver: cesm
105-
metadata:
106-
cache: {}
107-
catalog_dir: ''
108-
109-
>>> ds = cat.to_xarray()
110-
>>> ds
111-
<xarray.Dataset>
112-
Dimensions: (ens: 1, nlat: 5, nlon: 5, sigma: 5, time: 12)
113-
Coordinates:
114-
* sigma (sigma) float64 23.4 23.45 23.5 23.55 23.6
115-
* time (time) float64 9.092e+04 9.094e+04 ... 9.122e+04 9.125e+04
116-
Dimensions without coordinates: ens, nlat, nlon
117-
Data variables:
118-
TLAT (nlat, nlon) float64 dask.array<shape=(5, 5), chunksize=(5, 5)>
119-
ULONG (nlat, nlon) float64 dask.array<shape=(5, 5), chunksize=(5, 5)>
120-
ULAT (nlat, nlon) float64 dask.array<shape=(5, 5), chunksize=(5, 5)>
121-
TLONG (nlat, nlon) float64 dask.array<shape=(5, 5), chunksize=(5, 5)>
122-
O2 (ens, time, sigma, nlat, nlon) float32 dask.array<shape=(1, 12, 5, 5, 5), chunksize=(1, 1, 5, 5, 5)>
123-
>>>
28+
.. _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
@@ -1,4 +1,4 @@
1-
name: intake-cesm-dev
1+
name: intake-esm-dev
22
channels:
33
- conda-forge
44
dependencies:

ci/environment-dev-3.7.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: intake-cesm-dev
1+
name: intake-esm-dev
22
channels:
33
- conda-forge
44
dependencies:
@@ -31,5 +31,6 @@ dependencies:
3131
- tqdm
3232
- xarray
3333
- pip=18.1
34+
- make
3435
- pip:
3536
- sphinx_copybutton

0 commit comments

Comments
 (0)