Skip to content

Commit

Permalink
Update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
andersy005 committed Mar 20, 2019
1 parent b16f408 commit 29b1bea
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 54 deletions.
6 changes: 4 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ include README.rst
include requirements.txt

recursive-include intake_esm *.yaml
recursive-include tests
recursive-include example_input
recursive-include tests *.py
recursive-include tests *.nc
recursive-include tests *yml
recursive-include tests *yaml
recursive-include intake_esm *.py
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
Expand Down
24 changes: 5 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,19 @@ clean-pyc:
find . -name '*~' -exec rm -f {} +

lint:
flake8 intake_esm test
flake8 intake_esm
black --check --line-length=100 -S --exclude='intake_esm/_version.py|versioneer.py' intake_esm
isort --recursive -w 100 --check-only intake_esm

test:
py.test
pytest -v

test-all:
tox

coverage:
coverage run --source intake_esm setup.py test
coverage report -m
coverage html
pytest --cov-report=html --cov=./ tests/ --verbose
open htmlcov/index.html

docs:
rm -f docs/intake_esm.rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ intake_esm
$(MAKE) -C docs clean
$(MAKE) -C docs html
open docs/_build/html/index.html

release: clean
python setup.py sdist upload
python setup.py bdist_wheel upload

sdist: clean
python setup.py sdist
python setup.py bdist_wheel upload
ls -l dist
28 changes: 3 additions & 25 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
API reference
=============

This is a reference API class listing, and modules.

.. autosummary::
intake_esm.core.ESMMetadataStoreCatalog
intake_esm.cmip.CMIPSource
intake_esm.cmip.CMIPCollection
intake_esm.cesm.CESMSource
intake_esm.cesm.CESMCollection


.. autoclass:: intake_esm.core.ESMMetadataStoreCatalog
:members: search, open_collection


.. autoclass:: intake_esm.cesm.CESMSource
:members: to_xarray, results

.. autoclass:: intake_esm.cesm.CESMCollection
:members:

.. autoclass:: intake_esm.cmip.CMIPSource
:members: to_xarray, results

.. autoclass:: intake_esm.cmip.CMIPCollection
:members:
.. automodule:: intake_esm.core
:members:
:show-inheritance:
3 changes: 2 additions & 1 deletion intake_esm/cesm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class CESMCollection(Collection):
See Also
--------
intake_esm.core.ESMMetadataStoreCatalog
intake_esm.cmip.CMIPCollection
intake_esm.cmip.CMIP5Collection
intake_esm.cmip.CMIP6Collection
"""

def __init__(self, collection_spec):
Expand Down
18 changes: 12 additions & 6 deletions intake_esm/cmip.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,22 @@ def __init__(self, collection_spec):
self.root_dir = self.collection_spec['data_sources']['root_dir']['urlpath']

def build(self):
""" Build collection and return a pandas Dataframe
""" Builds CMIP5 collection and returns a pandas Dataframe
Notes
------
Directory structure = <activity>/
<product>/
<institute>/
<model>/
<experiment>/
<frequency>/
<modeling_realm>/
<MIP table>/
<modeling_realm>/
<MIP table>/
<ensemble member>/
<version number>/
<variable name>
with ``depth=7``, we retrieve all directories up to ``realm`` level
With ``depth=7``, we retrieve all directories up to ``modeling_realm`` level
Reference: CMIP5 DRS: https://cmip.llnl.gov/cmip5/docs/cmip5_data_reference_syntax_v1-00_clean.pdf
"""
self.build_cmip(depth=7, exclude_dirs=['files', 'latest'])
Expand Down Expand Up @@ -127,6 +130,10 @@ def __init__(self, collection_spec):

def build(self):
"""
Builds CMIP6 collection and returns a pandas Dataframe
Notes
-----
Directory structure = <mip_era>/
<activity_id>/
<institution_id>/
Expand All @@ -137,8 +144,7 @@ def build(self):
<variable_id>/
<grid_label>/
<version>
with ``depth=9``, we retrieve all directories up to ``grid_label`` level
With ``depth=9``, we retrieve all directories up to ``grid_label`` level
Reference: CMIP6 DRS: http://goo.gl/v1drZl
"""
self.build_cmip(depth=9, exclude_dirs=[])
Expand Down
3 changes: 2 additions & 1 deletion intake_esm/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class ESMMetadataStoreCatalog(Catalog):
Collection type. Accepted values include:
- `cesm`
- `cmip`
- `cmip5`
- `cmip6`
overwrite_existing : bool,
Whether to overwrite existing built collection catalog
Expand Down

0 comments on commit 29b1bea

Please sign in to comment.