Skip to content

Commit

Permalink
Added additional docstring documentation to gmt classes and modules
Browse files Browse the repository at this point in the history
  • Loading branch information
akshmakov committed Aug 12, 2018
1 parent 5ed2bae commit f48dd00
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 7 deletions.
10 changes: 9 additions & 1 deletion nc5ng/gmt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
""" GMT Wrapper for nc5ng"""
"""
GMT Wrapper Library and Convenience Methods for ``nc5ng``
.. automodule:: nc5ng.gmt.options
.. automodule:: nc5ng.gmt.plotter
"""

from .plotter import GMTPlotter
from .options import GMTOptions, PLOT_OPTS
Expand Down
13 changes: 10 additions & 3 deletions nc5ng/gmt/options.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
"""nc5ng.gmt.options
"""
GMT Options
-----------
GMTOptions form a loose wrapper on the GMT command line arguments and GMT/Python shorthands
It is a subtype of ``dict`` but has additional properties for creating appropirate GMT arguments
.. autoclass:: nc5ng.gmt.GMTOptions
module that defines GMT Option Mapping, default options.
"""


Expand Down Expand Up @@ -81,7 +88,7 @@ def prop_get(self):
return prop_get

class GMTOptions(dict):
"""GMTOptions is a decorated dictionary to wrap GMT/Python Keyword options
"""GMTOptions are decorated dictionaries to wrap GMT/Python Keyword options
GMTOptions takes keywords or other dictionary to construct gmt plot options for
`basemap`, `coast`, `plot` via properties `GMTOptions.basemap`, `.coast` `.plot`
Expand Down
33 changes: 30 additions & 3 deletions nc5ng/gmt/plotter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
"""nc5ng.gmt.plotter
"""
GMT Plotter
-----------
GMTPlotter forms a loose wrapper around ``gmt.Figure`` object, that constructs plots from embedded gmt options inside ``nc5ng`` objects (meta-api, ``object.gmt_meta``)
.. autoclass:: GMTPlotter
:members:
module that defines GMT Plotting Utilities for nc5ng conversions
"""

from numpy import array
Expand All @@ -11,7 +18,9 @@
class GMTPlotter(object):
"""GMTPlotter
Wrapper for GMT/Python plotter
Wrapper for GMT/Python Plotter
"""

Expand All @@ -32,6 +41,24 @@ def show(self, *args, **kwargs):

@staticmethod
def plot_conversion(conversion, coverage='all', vector='all', plotter=None, **kwargs):
""" Static Method to Plot an ``nc5ng.nc5data.Conversion``
Plotting options are Applied in the order
1. GMTPlotter configured or default options
2. Conversion configured options ``Conversion.gmt_meta``
3. Data Set Options ``PointData.gmt_meta``
4. Keyword overrides (full option name)
5. Keyowrd overrides (single letter GMT Style arguments)
:param conversion: Conversion data
:param coverage: Coverage files (no file extension), to plot.
Can be list of names (``coverage = ['cvacdlat','cvacdlon',]``), single file name (``coverage = 'cvacdlat'``), ``None``, or ``'all'``
:param vector: Vector files (no file extension) to plot. Can be list of names, single file name, ``None``, or ``'all'``.
:param plotter: plotter to use, if ``None`` one will be created and returned
"""
if plotter is None:
plotter = GMTPlotter()

Expand Down

0 comments on commit f48dd00

Please sign in to comment.