Skip to content

Use consistently 1-D, 2-D, or 3-D (with hyphen and capitalized) #2252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 53 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
a6d32a1
Use 'X-D' in docs 'blockm.py'
yvonnefroehlich Dec 16, 2022
adf5967
Use 'x-D' in doc 'binstats.py'
yvonnefroehlich Dec 16, 2022
b9835d8
Use 'x-D' in doc 'contour.py'
yvonnefroehlich Dec 16, 2022
b01adb1
Use 'x-D' in doc 'grdtrack.py'
yvonnefroehlich Dec 16, 2022
123ac02
Use 'x-D' in doc 'histogram.py'
yvonnefroehlich Dec 16, 2022
437b149
Use 'x-D' in doc 'info.py'
yvonnefroehlich Dec 16, 2022
6439d5d
Use 'x-D' in doc 'nearneighbor.py'
yvonnefroehlich Dec 16, 2022
0c35fde
Use 'x-D' in doc 'plot.py'
yvonnefroehlich Dec 16, 2022
a2bdc90
Use 'x-D' in doc 'plot3d.py'
yvonnefroehlich Dec 16, 2022
eb6a829
Use 'x-D' in doc 'project.py'
yvonnefroehlich Dec 16, 2022
f2abc40
Use 'x-D' in doc 'rose.py'
yvonnefroehlich Dec 16, 2022
be544f3
Use 'x-D' in doc 'select.py'
yvonnefroehlich Dec 16, 2022
809738d
Use 'x-D' in doc 'sph2grd.py'
yvonnefroehlich Dec 16, 2022
bfa153e
Use 'x-D' in doc 'sphdistance.py'
yvonnefroehlich Dec 16, 2022
010aa01
Use 'x-D' in doc 'sphinterpolate.py'
yvonnefroehlich Dec 16, 2022
1326d71
Use 'x-D' in doc 'surface.py'
yvonnefroehlich Dec 16, 2022
c44bd48
Use 'x-D' in doc 'ternary.py'
yvonnefroehlich Dec 16, 2022
5e12575
Use 'x-D' in doc 'text.py'
yvonnefroehlich Dec 16, 2022
b3a0431
Use 'x-D' in doc 'triangulate.py'
yvonnefroehlich Dec 16, 2022
ad03e8f
Use 'x-D' in doc 'velo.py'
yvonnefroehlich Dec 16, 2022
1cbc36b
Use 'x-D' in doc 'wiggle.py'
yvonnefroehlich Dec 16, 2022
14cfe2b
Use 'x-D' in doc 'xyz2grd.py'
yvonnefroehlich Dec 16, 2022
c6623d7
Use 'x-D' in doc 'meca.py'
yvonnefroehlich Dec 16, 2022
6dcf7cf
Fix line length in doc 'plot3d.py'
yvonnefroehlich Dec 16, 2022
2233529
Use 'x-D' in 'decorators.py'
yvonnefroehlich Dec 16, 2022
860f002
Use 'x-D' in 'utils.py'
yvonnefroehlich Dec 16, 2022
1861953
Use 'x-D' in test 'test_meca.py'
yvonnefroehlich Dec 16, 2022
bd8da92
Use 'x-D' in test 'test_clib_put_matrix.py'
yvonnefroehlich Dec 16, 2022
649c7f3
Use 'x-D' in test 'test_info'
yvonnefroehlich Dec 16, 2022
b5b0979
Use 'x-D' in test 'test_accessor.py'
yvonnefroehlich Dec 16, 2022
899ee6e
Use 'x-D' in test 'test_rose.py'
yvonnefroehlich Dec 16, 2022
dc63919
Use 'x-D' in test 'test_clib.py'
yvonnefroehlich Dec 16, 2022
53da4a1
Use 'x-D' in test 'test_grdview.py'
yvonnefroehlich Dec 16, 2022
2024210
Use 'x-D' in test 'test_plot3d.py'
yvonnefroehlich Dec 16, 2022
37ea2cf
Fix line length in test 'test_plot3d'
yvonnefroehlich Dec 16, 2022
21f4b16
[format-command] fixes
actions-bot Dec 16, 2022
ac547fd
Fix line length in test 'test_plot3d.py'
yvonnefroehlich Dec 16, 2022
df1ef39
Use 'x-D' in gallery 'contours.py'
yvonnefroehlich Dec 17, 2022
b926397
Use 'x-D' in gallery 'wiggle.py'
yvonnefroehlich Dec 17, 2022
db27e1b
Use 'x-D' in gallery 'meca.py'
yvonnefroehlich Dec 17, 2022
979ff1b
Use 'x-D' in gallery 'multi_parameter_symbols.py'
yvonnefroehlich Dec 17, 2022
b1502ee
Use 'x-D' in gallery 'track_sampling.py'
yvonnefroehlich Dec 17, 2022
47778af
Use 'x-D' in gallery 'points_categorical.py'
yvonnefroehlich Dec 17, 2022
9790ad6
Use 'x-D' in gallery 'scatter3d.py'
yvonnefroehlich Dec 17, 2022
59d8eb0
Use 'x-D' in tutorial 'vectors.py'
yvonnefroehlich Dec 17, 2022
07b7c89
Use 'x-D' in tutorial '3d_perspecive.py'
yvonnefroehlich Dec 17, 2022
68671a0
Fix typo in gallery 'scatter3d.py'
yvonnefroehlich Dec 17, 2022
6563be1
Merge branch 'main' into fix-typos-11
yvonnefroehlich Dec 18, 2022
eeb443f
Fix line length in gallery 'wiggle.py'
yvonnefroehlich Dec 18, 2022
0695eee
Merge branch 'main' into fix-typos-11
yvonnefroehlich Dec 19, 2022
c91a552
Merge branch 'main' into fix-typos-11
yvonnefroehlich Dec 20, 2022
3f2f5d8
Merge branch 'main' into fix-typos-11
yvonnefroehlich Dec 22, 2022
6babe0d
Merge branch 'main' into fix-typos-11
yvonnefroehlich Dec 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions examples/gallery/3d_plots/scatter3d.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""
3D Scatter plots
----------------
3-D Scatter plots
-----------------

The :meth:`pygmt.Figure.plot3d` method can be used to plot symbols in 3D.
The :meth:`pygmt.Figure.plot3d` method can be used to plot symbols in 3-D.
In the example below, we show how the
`Iris flower dataset <https://en.wikipedia.org/wiki/Iris_flower_data_set>`__
can be visualized using a perspective 3D plot. The ``region``
can be visualized using a perspective 3-D plot. The ``region``
parameter has to include the :math:`x`, :math:`y`, :math:`z` axis limits in the
form of (xmin, xmax, ymin, ymax, zmin, zmax), which can be done automatically
using :func:`pygmt.info`. To plot the z-axis frame, set ``frame`` as a
Expand Down Expand Up @@ -42,7 +42,7 @@
spacing=(1, 2, 0.5),
)

# Make a 3D scatter plot, coloring each of the 3 species differently
# Make a 3-D scatter plot, coloring each of the 3 species differently
fig = pygmt.Figure()

# Define a colormap to be used for three categories, define the range of the
Expand All @@ -69,7 +69,7 @@
# Vary each symbol size according to another feature (sepal width, scaled
# by 0.1)
size=0.1 * df.sepal_width,
# Use 3D cubes ("u") as symbols, with size in centimeter units ("c")
# Use 3-D cubes ("u") as symbols, with size in centimeter units ("c")
style="uc",
# Points colored by categorical number code
fill=df.species.cat.codes.astype(int),
Expand Down
8 changes: 4 additions & 4 deletions examples/gallery/images/contours.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
points by direct triangulation. The data for the triangulation can be provided
using one of three methods:

#. ``x``, ``y``, ``z`` 1d :class:`numpy.ndarray` data columns.
#. ``data`` 2d :class:`numpy.ndarray` data matrix with 3 columns corresponding
#. ``x``, ``y``, ``z`` 1-D :class:`numpy.ndarray` data columns.
#. ``data`` 2-D :class:`numpy.ndarray` data matrix with 3 columns corresponding
to ``x``, ``y``, ``z``.
#. ``data`` path string to a file containing the ``x``, ``y``, ``z`` in a
tabular format.

The parameters ``levels`` and ``annotation`` set the intervals of the contours
and the annotation on the contours respectively.

In this example we supply the data as 1d :class:`numpy.ndarray` with the
In this example we supply the data as 1-D :class:`numpy.ndarray` with the
``x``, ``y``, and ``z`` parameters and draw the contours using a 0.5p pen with
contours every 10 ``z`` values and annotations every 20 ``z`` values.
"""
Expand All @@ -35,7 +35,7 @@
projection="X10c/10c",
frame="ag",
pen="0.5p",
# pass the data as 3 1d data columns
# pass the data as 3 1-D data columns
x=x,
y=y,
z=z,
Expand Down
11 changes: 6 additions & 5 deletions examples/gallery/images/track_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
---------------------

The :func:`pygmt.grdtrack` function samples a raster grid's value along
specified points. We will need to input a 2D raster to ``grid`` which can be an
:class:`xarray.DataArray`. The argument passed to the ``points`` parameter can
be a :class:`pandas.DataFrame` table where the first two columns are x and y
(or longitude and latitude). Note also that there is a ``newcolname`` parameter
that will be used to name the new column of values sampled from the grid.
specified points. We will need to input a 2-D raster to ``grid`` which can be
an :class:`xarray.DataArray`. The argument passed to the ``points`` parameter
can be a :class:`pandas.DataFrame` table where the first two columns are
x and y (or longitude and latitude). Note also that there is a ``newcolname``
parameter that will be used to name the new column of values sampled from the
grid.

Alternatively, a NetCDF file path can be passed to ``grid``. An ASCII file path
can also be accepted for ``points``. To save an output ASCII file, a file name
Expand Down
8 changes: 4 additions & 4 deletions examples/gallery/lines/wiggle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
-------------------

The :meth:`pygmt.Figure.wiggle` method can plot z = f(x,y) anomalies along
tracks. ``x``, ``y``, ``z`` can be specified as 1d arrays or within a specified
file. The ``scale`` parameter can be used to set the scale of the anomaly in
data/distance units. The positive and/or negative areas can be filled with
color by setting the ``color`` parameter.
tracks. ``x``, ``y``, ``z`` can be specified as 1-D arrays or within a
specified file. The ``scale`` parameter can be used to set the scale of the
anomaly in data/distance units. The positive and/or negative areas can be
filled with color by setting the ``color`` parameter.
"""

import numpy as np
Expand Down
6 changes: 3 additions & 3 deletions examples/gallery/seismology/meca.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

The :meth:`pygmt.Figure.meca` method can plot focal mechanisms or beachballs.
We can specify the focal mechanism nodal planes or moment tensor components as
a dictionary using the ``spec`` parameter (or they can be specified as a 1d or
2d array, or within a specified file). The size of plotted beachballs can be
specified using the ``scale`` parameter.
a dictionary using the ``spec`` parameter (or they can be specified as a 1-D
or 2-D array, or within a specified file). The size of plotted beachballs can
be specified using the ``scale`` parameter.
"""

import pygmt
Expand Down
6 changes: 3 additions & 3 deletions examples/gallery/symbols/multi_parameter_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
###############################################################################
# We can plot multi-parameter symbols using the same symbol style. We need to
# define locations (lon, lat) via the ``x`` and ``y`` parameters (scalar for
# a single symbol or 1d list for several ones) and two or three symbol
# a single symbol or 1-D list for several ones) and two or three symbol
# parameters after those shortcuts via the ``style`` parameter.
#
# The multi-parameter symbols in the ``style`` parameter are defined as:
Expand Down Expand Up @@ -54,11 +54,11 @@

###############################################################################
# We can also plot symbols with varying parameters via defining those values in
# a 2d list or numpy array (``[[parameters]]`` for a single symbol or
# a 2-D list or numpy array (``[[parameters]]`` for a single symbol or
# ``[[parameters_1],[parameters_2],[parameters_i]]`` for several ones) or using
# an appropriately formatted input file and passing it to ``data``.
#
# The symbol parameters in the 2d list or numpy array are defined as:
# The symbol parameters in the 2-D list or numpy array are defined as:
#
# - **e**: ellipse, ``[[lon, lat, direction, major_axis, minor_axis]]``
# - **j**: rotated rectangle, ``[[lon, lat, direction, width, height]]``
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/symbols/points_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
spacing=(3, 2),
)

# Make a 2D categorical scatter plot, coloring each of the 3 species
# Make a 2-D categorical scatter plot, coloring each of the 3 species
# differently
fig = pygmt.Figure()

Expand Down
4 changes: 2 additions & 2 deletions examples/tutorials/advanced/3d_perspective_image.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Creating a 3D perspective image
===============================
Creating a 3-D perspective image
================================

Create 3-D perspective image or surface mesh from a grid
using :meth:`pygmt.Figure.grdview`.
Expand Down
8 changes: 4 additions & 4 deletions examples/tutorials/advanced/vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# On the shown figure, the plot is projected on a 10cm X 10cm region,
# which is specified by the ``projection`` parameter.
# The direction is specified
# by a list of two 1d arrays structured as ``[[angle_in_degrees], [length]]``.
# by a list of two 1-D arrays structured as ``[[angle_in_degrees], [length]]``.
# The angle is measured in degrees and moves counter-clockwise from the
# horizontal.
# The length of the vector uses centimeters by default but
Expand Down Expand Up @@ -107,7 +107,7 @@
###############################################################################
# Vectors can also be plotted by including all the information
# about a vector in a single list. However, this requires creating
# a 2D list or numpy array containing all vectors.
# a 2-D list or numpy array containing all vectors.
# Each vector list contains the information structured as:
# ``[x_start, y_start, direction_degrees, length]``.
#
Expand All @@ -132,7 +132,7 @@
###############################################################################
# Using the functionality mentioned in the previous example,
# multiple vectors can be plotted at the same time. Another
# vector could be simply added to the 2D list or numpy
# vector could be simply added to the 2-D list or numpy
# array object and passed using ``data`` parameter.

# Vector specifications structured as:
Expand Down Expand Up @@ -386,7 +386,7 @@
# of one is the starting point of another. This can be done
# by adding the coordinate lists together to create this structure:
# ``[[start_latitude, start_longitude, end_latitude, end_longitude]]``.
# Each list within the 2D list contains the start and end information
# Each list within the 2-D list contains the start and end information
# for each vector.

# Coordinate pairs for all the locations used
Expand Down
18 changes: 9 additions & 9 deletions pygmt/helpers/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
(e.g., *color1*,\ *color2*,\ *color3*) to build a linear continuous
CPT from those colors automatically.""",
"color": """\
color : str or 1d array
color : str or 1-D array
Select color or pattern for filling of symbols or polygons [Default
is no fill].""",
"fill": """\
Expand Down Expand Up @@ -227,13 +227,13 @@

Blank lines and lines starting with \# are always skipped.""",
"incols": r"""
incols : str or 1d array
incols : str or 1-D array
Specify data columns for primary input in arbitrary order. Columns
can be repeated and columns not listed will be skipped [Default
reads all columns in order, starting with the first (i.e., column
0)].

- For *1d array*: specify individual columns in input order (e.g.,
- For *1-D array*: specify individual columns in input order (e.g.,
``incols=[1,0]`` for the 2nd column followed by the 1st column).
- For :py:class:`str`: specify individual columns or column
ranges in the format *start*\ [:*inc*]:*stop*, where *inc*
Expand Down Expand Up @@ -285,14 +285,14 @@
- **l** for bilinear
- **n** for nearest-neighbor""",
"outcols": r"""
outcols : str or 1d array
outcols : str or 1-D array
*cols*\ [,...][,\ **t**\ [*word*]].
Specify data columns for primary output in arbitrary order. Columns
can be repeated and columns not listed will be skipped [Default
writes all columns in order, starting with the first (i.e., column
0)].

- For *1d array*: specify individual columns in output order (e.g.,
- For *1-D array*: specify individual columns in output order (e.g.,
``outcols=[1,0]`` for the 2nd column followed by the 1st column).
- For :py:class:`str`: specify individual columns or column
ranges in the format *start*\ [:*inc*]:*stop*, where *inc*
Expand Down Expand Up @@ -408,7 +408,7 @@ def fmt_docstring(module_func):
... Parameters
... ----------
... data : str or {table-like}
... Pass in either a file name to an ASCII data table, a 2D
... Pass in either a file name to an ASCII data table, a 2-D
... {table-classes}.
... {region}
... {projection}
Expand All @@ -424,9 +424,9 @@ def fmt_docstring(module_func):
Parameters
----------
data : str or numpy.ndarray or pandas.DataFrame or xarray.Dataset or geo...
Pass in either a file name to an ASCII data table, a 2D
Pass in either a file name to an ASCII data table, a 2-D
:class:`numpy.ndarray`, a :class:`pandas.DataFrame`, an
:class:`xarray.Dataset` made up of 1D :class:`xarray.DataArray`
:class:`xarray.Dataset` made up of 1-D :class:`xarray.DataArray`
data variables, or a :class:`geopandas.GeoDataFrame` containing the
tabular data.
region : str or list
Expand Down Expand Up @@ -461,7 +461,7 @@ def fmt_docstring(module_func):
)
filler_text["table-classes"] = (
":class:`numpy.ndarray`, a :class:`pandas.DataFrame`, an\n"
" :class:`xarray.Dataset` made up of 1D :class:`xarray.DataArray`\n"
" :class:`xarray.Dataset` made up of 1-D :class:`xarray.DataArray`\n"
" data variables, or a :class:`geopandas.GeoDataFrame` containing the\n"
" tabular data"
)
Expand Down
8 changes: 4 additions & 4 deletions pygmt/helpers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def data_kind(data, x=None, y=None, z=None, required_z=False):
* a pathlib.Path provided as 'data'
* an xarray.DataArray provided as 'data'
* a matrix provided as 'data'
* 1D arrays x and y (and z, optionally)
* 1-D arrays x and y (and z, optionally)

Arguments should be ``None`` if not used. If doesn't fit any of these
categories (or fits more than one), will raise an exception.
Expand All @@ -34,11 +34,11 @@ def data_kind(data, x=None, y=None, z=None, required_z=False):
----------
data : str or pathlib.Path or xarray.DataArray or {table-like} or None
Pass in either a file name or :class:`pathlib.Path` to an ASCII data
table, an :class:`xarray.DataArray`, a 1D/2D
table, an :class:`xarray.DataArray`, a 1-D/2-D
{table-classes}.
x/y : 1d arrays or None
x/y : 1-D arrays or None
x and y columns as numpy arrays.
z : 1d array or None
z : 1-D array or None
z column as numpy array. To be used optionally when x and y are given.
required_z : bool
State whether the 'z' column is required.
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/binstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def binstats(data, **kwargs):
Parameters
----------
data : str or {table-like}
A file name of an ASCII data table or a 2D
A file name of an ASCII data table or a 2-D
{table-classes}.
outgrid : str or None
The name of the output netCDF file with extension .nc to store the grid
Expand Down
12 changes: 6 additions & 6 deletions pygmt/src/blockm.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ def blockmean(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
----------
data : str or {table-like}
Pass in (x, y, z) or (longitude, latitude, elevation) values by
providing a file name to an ASCII data table, a 2D
providing a file name to an ASCII data table, a 2-D
{table-classes}.
x/y/z : 1d arrays
x/y/z : 1-D arrays
Arrays of x and y coordinates and values z of the data points.

{spacing}
Expand Down Expand Up @@ -204,9 +204,9 @@ def blockmedian(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
----------
data : str or {table-like}
Pass in (x, y, z) or (longitude, latitude, elevation) values by
providing a file name to an ASCII data table, a 2D
providing a file name to an ASCII data table, a 2-D
{table-classes}.
x/y/z : 1d arrays
x/y/z : 1-D arrays
Arrays of x and y coordinates and values z of the data points.

{spacing}
Expand Down Expand Up @@ -291,9 +291,9 @@ def blockmode(data=None, x=None, y=None, z=None, outfile=None, **kwargs):
----------
data : str or {table-like}
Pass in (x, y, z) or (longitude, latitude, elevation) values by
providing a file name to an ASCII data table, a 2D
providing a file name to an ASCII data table, a 2-D
{table-classes}.
x/y/z : 1d arrays
x/y/z : 1-D arrays
Arrays of x and y coordinates and values z of the data points.

{spacing}
Expand Down
4 changes: 2 additions & 2 deletions pygmt/src/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ def contour(self, data=None, x=None, y=None, z=None, **kwargs):
----------
data : str or {table-like}
Pass in (x, y, z) or (longitude, latitude, elevation) values by
providing a file name to an ASCII data table, a 2D
providing a file name to an ASCII data table, a 2-D
{table-classes}.
x/y/z : 1d arrays
x/y/z : 1-D arrays
Arrays of x and y coordinates and values z of the data points.
{projection}
{region}
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/grdtrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def grdtrack(grid, points=None, newcolname=None, outfile=None, **kwargs):
format).

points : str or {table-like}
Pass in either a file name to an ASCII data table, a 2D
Pass in either a file name to an ASCII data table, a 2-D
{table-classes}.

newcolname : str
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def histogram(self, data, **kwargs):
Parameters
----------
data : str or list or {table-like}
Pass in either a file name to an ASCII data table, a Python list, a 2D
Pass in either a file name to an ASCII data table, a Python list, a 2-D
{table-classes}.
{projection}
{region}
Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def info(data, **kwargs):
Parameters
----------
data : str or {table-like}
Pass in either a file name to an ASCII data table, a 1D/2D
Pass in either a file name to an ASCII data table, a 1-D/2-D
{table-classes}.
per_column : bool
Report the min/max values per column in separate columns.
Expand Down
Loading