Skip to content

Commit 2557e8f

Browse files
committed
Run "make format" to format all docstrings
1 parent 5236ac2 commit 2557e8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+520
-954
lines changed

doc/conf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
"""
3-
Sphinx documentation configuration file.
4-
"""
2+
"""Sphinx documentation configuration file."""
53
# pylint: disable=invalid-name
64

75
import datetime

pygmt/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ def test(doctest=True, verbose=True, coverage=False, figures=True):
163163
AssertionError
164164
If pytest returns a non-zero error code indicating that some tests have
165165
failed.
166-
167166
"""
168167
import pytest
169168

pygmt/base_plotting.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""
22
Base class with plot generating commands.
3+
34
Does not define any special non-GMT methods (savefig, show, etc).
45
"""
56
import contextlib
@@ -51,7 +52,6 @@ def _preprocess(self, **kwargs): # pylint: disable=no-self-use
5152
>>> base = BasePlotting()
5253
>>> base._preprocess(resolution="low")
5354
{'resolution': 'low'}
54-
5555
"""
5656
return kwargs
5757

@@ -78,7 +78,7 @@ def _preprocess(self, **kwargs): # pylint: disable=no-self-use
7878
@kwargs_to_strings(R="sequence", p="sequence")
7979
def coast(self, **kwargs):
8080
"""
81-
Plot continents, shorelines, rivers, and borders on maps
81+
Plot continents, shorelines, rivers, and borders on maps.
8282
8383
Plots grayshaded, colored, or textured land-masses [or water-masses] on
8484
maps and [optionally] draws coastlines, rivers, and political
@@ -138,7 +138,6 @@ def coast(self, **kwargs):
138138
{XY}
139139
{p}
140140
{t}
141-
142141
"""
143142
kwargs = self._preprocess(**kwargs)
144143
with Session() as lib:
@@ -224,7 +223,6 @@ def colorbar(self, **kwargs):
224223
{XY}
225224
{p}
226225
{t}
227-
228226
"""
229227
kwargs = self._preprocess(**kwargs)
230228
with Session() as lib:
@@ -253,7 +251,7 @@ def colorbar(self, **kwargs):
253251
@kwargs_to_strings(R="sequence", L="sequence", A="sequence_plus", p="sequence")
254252
def grdcontour(self, grid, **kwargs):
255253
"""
256-
Convert grids or images to contours and plot them on maps
254+
Convert grids or images to contours and plot them on maps.
257255
258256
Takes a grid file name or an xarray.DataArray object as input.
259257
@@ -469,7 +467,6 @@ def grdimage(self, grid, **kwargs):
469467
{p}
470468
{t}
471469
{x}
472-
473470
"""
474471
kwargs = self._preprocess(**kwargs)
475472
kind = data_kind(grid, None, None)
@@ -580,7 +577,6 @@ def grdview(self, grid, **kwargs):
580577
{XY}
581578
{p}
582579
{t}
583-
584580
"""
585581
kwargs = self._preprocess(**kwargs)
586582
kind = data_kind(grid, None, None)
@@ -778,7 +774,6 @@ def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
778774
{t}
779775
*transparency* can also be a 1d array to set varying transparency
780776
for symbols.
781-
782777
"""
783778
kwargs = self._preprocess(**kwargs)
784779

@@ -851,7 +846,7 @@ def plot3d(
851846
self, x=None, y=None, z=None, data=None, sizes=None, direction=None, **kwargs
852847
):
853848
"""
854-
Plot lines, polygons, and symbols in 3-D
849+
Plot lines, polygons, and symbols in 3-D.
855850
856851
Takes a matrix, (x,y,z) triplets, or a file name as input and plots
857852
lines, polygons, or symbols at those locations in 3-D.
@@ -961,7 +956,6 @@ def plot3d(
961956
{t}
962957
*transparency* can also be a 1d array to set varying transparency
963958
for symbols.
964-
965959
"""
966960
kwargs = self._preprocess(**kwargs)
967961

@@ -1083,7 +1077,6 @@ def contour(self, x=None, y=None, z=None, data=None, **kwargs):
10831077
{XY}
10841078
{p}
10851079
{t}
1086-
10871080
"""
10881081
kwargs = self._preprocess(**kwargs)
10891082

@@ -1159,7 +1152,6 @@ def basemap(self, **kwargs):
11591152
{XY}
11601153
{p}
11611154
{t}
1162-
11631155
"""
11641156
kwargs = self._preprocess(**kwargs)
11651157
if not ("B" in kwargs or "L" in kwargs or "T" in kwargs):
@@ -1216,7 +1208,6 @@ def logo(self, **kwargs):
12161208
{V}
12171209
{XY}
12181210
{t}
1219-
12201211
"""
12211212
kwargs = self._preprocess(**kwargs)
12221213
with Session() as lib:
@@ -1658,8 +1649,8 @@ def set_pointer(data_pointers, spec):
16581649

16591650
def update_pointers(data_pointers):
16601651
"""Updates variables based on the location of data, as the
1661-
following data can be passed as parameters or it can be
1662-
contained in `spec`."""
1652+
following data can be passed as parameters or it can be contained
1653+
in `spec`."""
16631654
# update all pointers
16641655
longitude = data_pointers["longitude"]
16651656
latitude = data_pointers["latitude"]

pygmt/clib/conversion.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Functions to convert data types into ctypes friendly formats.
3-
"""
1+
"""Functions to convert data types into ctypes friendly formats."""
42
import numpy as np
53
import pandas as pd
64

@@ -80,7 +78,6 @@ def dataarray_to_matrix(grid):
8078
[-150.5, -78.5, -80.5, -48.5]
8179
>>> print(inc)
8280
[2.0, 2.0]
83-
8481
"""
8582
if len(grid.dims) != 2:
8683
raise GMTInvalidInput(
@@ -159,7 +156,6 @@ def vectors_to_arrays(vectors):
159156
>>> data = [[1, 2], (3, 4), range(5, 7)]
160157
>>> all(isinstance(i, np.ndarray) for i in vectors_to_arrays(data))
161158
True
162-
163159
"""
164160
arrays = [as_c_contiguous(np.asarray(i)) for i in vectors]
165161
return arrays
@@ -201,7 +197,6 @@ def as_c_contiguous(array):
201197
True
202198
>>> as_c_contiguous(x).flags.c_contiguous
203199
True
204-
205200
"""
206201
if not array.flags.c_contiguous:
207202
return array.copy(order="C")
@@ -239,7 +234,6 @@ def kwargs_to_ctypes_array(argument, kwargs, dtype):
239234
... )
240235
>>> print(should_be_none)
241236
None
242-
243237
"""
244238
if argument in kwargs:
245239
return dtype(*kwargs[argument])

pygmt/clib/loading.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def load_libgmt():
3030
GMTCLibNotFoundError
3131
If there was any problem loading the library (couldn't find it or
3232
couldn't access the functions).
33-
3433
"""
3534
lib_fullnames = clib_full_names()
3635
error = True
@@ -64,7 +63,6 @@ def clib_names(os_name):
6463
-------
6564
libnames : list of str
6665
List of possible names of GMT's shared library.
67-
6866
"""
6967
if os_name.startswith("linux"):
7068
libnames = ["libgmt.so"]
@@ -93,7 +91,6 @@ def clib_full_names(env=None):
9391
-------
9492
lib_fullnames: list of str
9593
List of possible full names of GMT's shared library.
96-
9794
"""
9895
if env is None:
9996
env = os.environ
@@ -127,7 +124,6 @@ def check_libgmt(libgmt):
127124
Raises
128125
------
129126
GMTCLibError
130-
131127
"""
132128
# Check if a few of the functions we need are in the library
133129
functions = ["Create_Session", "Get_Enum", "Call_Module", "Destroy_Session"]

0 commit comments

Comments
 (0)