Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into mapping/grdview
Browse files Browse the repository at this point in the history
  • Loading branch information
weiji14 committed Dec 6, 2019
2 parents 04db99b + fff0d5c commit 6af9784
Show file tree
Hide file tree
Showing 33 changed files with 504 additions and 333 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ MANIFEST
.pytest_cache/
.ipynb_checkpoints/
.vscode/
tmp-test-dir-with-unique-name/
build/
dist/
doc/_build
Expand Down
15 changes: 13 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,17 @@ make check # Runs flake8 and black (in check mode)
make lint # Runs pylint, which is a bit slower
```

#### Docstrings

**All docstrings** should follow the
[numpy style guide](https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard).
All functions/classes/methods should have docstrings with a full description of all
arguments and return values.

While the maximum line length for code is automatically set by *Black*, docstrings
must be formatted manually. To play nicely with Jupyter and IPython, **keep docstrings
limited to 79 characters** per line.

### Testing your code

Automated testing helps ensure that our code is as free of bugs as it can be.
Expand Down Expand Up @@ -360,7 +371,7 @@ Sphinx will create a link to the automatically generated page for that
function/class/module.

**All docstrings** should follow the
[numpy style guide](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt).
[numpy style guide](https://numpydoc.readthedocs.io/en/latest/format.html).
All functions/classes/methods should have docstrings with a full description of all
arguments and return values.

Expand All @@ -379,7 +390,7 @@ Some things that will increase the chance that your pull request is accepted qui
*reason* behind non-obvious things.
* Include an example of new features in the gallery or tutorials.
* Follow the [PEP8](http://pep8.org) style guide for code and the
[numpy guide](https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt)
[numpy guide](https://numpydoc.readthedocs.io/en/latest/format.html)
for documentation.

Pull requests will automatically have tests run by TravisCI.
Expand Down
12 changes: 12 additions & 0 deletions doc/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@

.. autoclass:: {{ objname }}

.. rubric:: Methods Summary

.. autosummary::
{% for item in methods %}
{% if item != '__init__' %}
{{ objname }}.{{ item }}
{% endif %}
{% endfor %}

.. include:: backreferences/{{ fullname }}.examples

.. raw:: html

<div style='clear:both'></div>

9 changes: 6 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@
"sphinx.ext.viewcode",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"numpydoc",
"sphinx.ext.napoleon",
"nbsphinx",
"sphinx_gallery.gen_gallery",
]

# Autosummary pages will be generated by sphinx-autogen instead of sphinx-build
autosummary_generate = False
autosummary_generate = []

numpydoc_class_members_toctree = False
# Make the list of returns arguments and attributes render the same as the
# parameters list
napoleon_use_rtype = False
napoleon_use_ivar = True

# configure links to GMT docs
extlinks = {
Expand Down
8 changes: 4 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ channels:
dependencies:
- python=3.7
- pip
- gmt=6.0.0
- numpy
- pandas
- xarray
Expand All @@ -18,10 +19,9 @@ dependencies:
- pytest-mpl
- coverage
- black
- pylint
- pylint=2.2.2
- flake8
- sphinx<=1.8.5
- sphinx_rtd_theme
- sphinx=2.2.1
- sphinx_rtd_theme=0.4.3
- sphinx-gallery
- nbsphinx
- numpydoc
12 changes: 6 additions & 6 deletions pygmt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#
# The main API for PyGMT.
#
# All of PyGMT is operated on a "modern mode session" (new to GMT6). When you import the
# pygmt library, a new session will be started automatically. The session will be
# closed when the current Python process terminates. Thus, the Python API does not
# expose the `gmt begin` and `gmt end` commands.
# All of PyGMT is operated on a "modern mode session" (new to GMT6). When you
# import the pygmt library, a new session will be started automatically. The
# session will be closed when the current Python process terminates. Thus, the
# Python API does not expose the `gmt begin` and `gmt end` commands.

import atexit as _atexit

Expand Down Expand Up @@ -34,8 +34,8 @@ def print_clib_info():
"""
Print information about the GMT shared library that we can find.
Includes the GMT version, default values for parameters, the path to the ``libgmt``
shared library, and GMT directories.
Includes the GMT version, default values for parameters, the path to the
``libgmt`` shared library, and GMT directories.
"""
from .clib import Session

Expand Down
Loading

0 comments on commit 6af9784

Please sign in to comment.