Skip to content

Commit 44f941b

Browse files
committed
Use table-classes filler in docstring description
1 parent 7121c31 commit 44f941b

File tree

10 files changed

+28
-35
lines changed

10 files changed

+28
-35
lines changed

pygmt/helpers/decorators.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ def fmt_docstring(module_func):
232232
"xarray.Dataset"
233233
# "geopandas.GeoDataFrame"
234234
)
235+
filler_text["table-classes"] = (
236+
":class:`numpy.ndarray`, a :class:`pandas.DataFrame`, or an \n"
237+
" :class:`xarray.Dataset` made up of 1D :class:`xarray.DataArray` \n"
238+
" data variables containing the tabular data."
239+
)
235240

236241
for marker, text in COMMON_OPTIONS.items():
237242
# Remove the indentation and the first line break from the multiline

pygmt/helpers/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ def data_kind(data, x=None, y=None, z=None):
3232
----------
3333
data : str or xarray.DataArray or {table-like} or None
3434
Pass in either a file name to an ASCII data table, an
35-
:class:`xarray.DataArray`, a 1D/2D :class:`numpy.ndarray`, a
36-
:class:`pandas.DataFrame`, or an :class:`xarray.Dataset` made up of 1D
37-
:class:`xarray.DataArray` data variables.
35+
:class:`xarray.DataArray`, a 1D/2D
36+
{table-classes}.
3837
x/y : 1d arrays or None
3938
x and y columns as numpy arrays.
4039
z : 1d array or None

pygmt/src/grdtrack.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ def grdtrack(points, grid, newcolname=None, outfile=None, **kwargs):
3737
----------
3838
points : str or {table-like}
3939
Pass in either a file name to an ASCII data table, a 2D
40-
:class:`numpy.ndarray`, a :class:`pandas.DataFrame`, or an
41-
:class:`xarray.Dataset` made up of 1D :class:`xarray.DataArray` data
42-
variables containing the tabular data.
40+
{table-classes}.
4341
4442
grid : xarray.DataArray or str
4543
Gridded array from which to sample values from, or a filename (netcdf

pygmt/src/histogram.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ def histogram(self, table, **kwargs):
4646
----------
4747
table : str or list or {table-like}
4848
Pass in either a file name to an ASCII data table, a Python list, a 2D
49-
:class:`numpy.ndarray`, a :class:`pandas.DataFrame`, or an
50-
:class:`xarray.Dataset` made up of 1D :class:`xarray.DataArray` data
51-
variables containing the tabular data. This is a required argument.
49+
{table-classes}.
50+
This is a required argument.
5251
{J}
5352
{R}
5453
{B}

pygmt/src/info.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ def info(table, **kwargs):
4848
----------
4949
table : str or {table-like}
5050
Pass in either a file name to an ASCII data table, a 1D/2D
51-
:class:`numpy.ndarray`, a :class:`pandas.DataFrame`, or an
52-
:class:`xarray.Dataset` made up of 1D :class:`xarray.DataArray` data
53-
variables containing the tabular data.
51+
{table-classes}.
5452
per_column : bool
5553
Report the min/max values per column in separate columns.
5654
spacing : str

pygmt/src/plot.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@ def plot(self, x=None, y=None, data=None, size=None, direction=None, **kwargs):
7878
data points
7979
data : str or {table-like}
8080
Pass in either a file name to an ASCII data table, a 2D
81-
:class:`numpy.ndarray`, a :class:`pandas.DataFrame`, or an
82-
:class:`xarray.Dataset` made up of 1D :class:`xarray.DataArray` data
83-
variables containing the tabular data. Use parameter ``columns`` to
84-
choose which columns are x, y, color, and size, respectively.
81+
{table-classes}.
82+
Use parameter ``columns`` to choose which columns are x, y, color, and
83+
size, respectively.
8584
size : 1d array
8685
The size of the data points in units specified using ``style``.
8786
Only valid if using ``x``/``y``.

pygmt/src/plot3d.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@ def plot3d(
8080
the data points
8181
data : str or {table-like}
8282
Pass in either a file name to an ASCII data table, a 2D
83-
:class:`numpy.ndarray`, a :class:`pandas.DataFrame`, or an
84-
:class:`xarray.Dataset` made up of 1D :class:`xarray.DataArray` data
85-
variables containing the tabular data. Use parameter ``columns`` to
86-
choose which columns are x, y, z, color, and size, respectively.
83+
{table-classes}.
84+
Use parameter ``columns`` to choose which columns are x, y, z, color,
85+
and size, respectively.
8786
size : 1d array
8887
The size of the data points in units specified in ``style``.
8988
Only valid if using ``x``/``y``/``z``.

pygmt/src/rose.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,11 @@ def rose(self, length=None, azimuth=None, data=None, **kwargs):
6161
6262
data : str or {table-like}
6363
Pass in either a file name to an ASCII data table, a 2D
64-
:class:`numpy.ndarray`, a :class:`pandas.DataFrame`, or an
65-
:class:`xarray.Dataset` made up of 1D :class:`xarray.DataArray` data
66-
variables containing the tabular data. Use option ``columns`` to choose
67-
which columns are length and azimuth, respectively. If a file with only
68-
azimuths is given, use ``columns`` to indicate the single column with
69-
azimuths; then all lengths are set to unity (see ``scale = 'u'`` to set
70-
actual lengths to unity as well).
64+
{table-classes}.
65+
Use option ``columns`` to choose which columns are length and azimuth,
66+
respectively. If a file with only azimuths is given, use ``columns`` to
67+
indicate the single column with azimuths; then all lengths are set to
68+
unity (see ``scale = 'u'`` to set actual lengths to unity as well).
7169
7270
orientation : bool
7371
Specifies that the input data are orientation data (i.e., have a

pygmt/src/velo.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ def velo(self, data=None, **kwargs):
5555
----------
5656
data : str or {table-like}
5757
Pass in either a file name to an ASCII data table, a 2D
58-
:class:`numpy.ndarray`, a :class:`pandas.DataFrame`, or an
59-
:class:`xarray.Dataset` made up of 1D :class:`xarray.DataArray` data
60-
variables containing the tabular data. Note that text columns are only
61-
supported with file or pandas DataFrame inputs.
58+
{table-classes}.
59+
Note that text columns are only supported with file or pandas DataFrame
60+
inputs.
6261
6362
spec: str
6463
Selects the meaning of the columns in the data file and the figure to

pygmt/src/wiggle.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ def wiggle(self, x=None, y=None, z=None, data=None, **kwargs):
4343
The arrays of x and y coordinates and z data points.
4444
data : str or {table-like}
4545
Pass in either a file name to an ASCII data table, a 2D
46-
:class:`numpy.ndarray`, a :class:`pandas.DataFrame`, or an
47-
:class:`xarray.Dataset` made up of 1D :class:`xarray.DataArray` data
48-
variables containing the tabular data. Use parameter ``columns`` to
49-
choose which columns are x, y, z, respectively.
46+
{table-classes}.
47+
Use parameter ``columns`` to choose which columns are x, y, z,
48+
respectively.
5049
{J}
5150
{R}
5251
scale : str or float

0 commit comments

Comments
 (0)