Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
7 changes: 4 additions & 3 deletions pygmt/src/grdproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
from pygmt.alias import Alias, AliasSystem
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import build_arg_list, fmt_docstring, use_alias
from pygmt.helpers import build_arg_list, deprecate_parameter, fmt_docstring, use_alias

__doctest_skip__ = ["grdproject"]


@fmt_docstring
@use_alias(E="dpi", F="scaling", I="inverse", M="unit", n="interpolation")
@deprecate_parameter("unit", "units", "v0.18.0", remove_version="v0.20.0")
@use_alias(E="dpi", F="scaling", I="inverse", M="units", n="interpolation")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be unit, not units, since it takes one single unit in this module.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering it it makes sense to have this consistent across function / methods and always use plural.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use unit and units in different cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we only want to change pygmt.project?

def grdproject(
grid: PathLike | xr.DataArray,
outgrid: PathLike | None = None,
Expand Down Expand Up @@ -83,7 +84,7 @@ def grdproject(
**k** (kilometers), **M** (statute miles), **n** (nautical miles),
**u** (US survey feet), **i** (inches), **c** (centimeters), or
**p** (points).
unit : str
units : str
Append **c**, **i**, or **p** to indicate that centimeters, inches, or
points should be the projected measure unit. Cannot be used with
``scaling``.
Expand Down
6 changes: 4 additions & 2 deletions pygmt/src/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import (
build_arg_list,
deprecate_parameter,
fmt_docstring,
use_alias,
validate_output_table_type,
)


@fmt_docstring
@deprecate_parameter("unit", "units", "v0.18.0", remove_version="v0.20.0")
@use_alias(
A="azimuth",
F="convention",
G="generate",
N="flat_earth",
Q="unit",
Q="units",
S="sort",
Z="ellipse",
f="coltypes",
Expand Down Expand Up @@ -174,7 +176,7 @@ def project( # noqa: PLR0913
Make a Cartesian coordinate transformation in the plane.
[Default is ``False``; plane created with spherical trigonometry.]

unit : bool
units : bool
Set units for :math:`x, y, r, s` to degrees and
:math:`p, q, dist, l_{min}, l_{max}, w_{min}, w_{max}` to km.
[Default is ``False``; all arguments use the same units]
Expand Down
7 changes: 4 additions & 3 deletions pygmt/src/sphdistance.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@
from pygmt.alias import Alias, AliasSystem
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import build_arg_list, fmt_docstring, use_alias
from pygmt.helpers import build_arg_list, deprecate_parameter, fmt_docstring, use_alias

__doctest_skip__ = ["sphdistance"]


@fmt_docstring
@deprecate_parameter("unit", "units", "v0.18.0", remove_version="v0.20.0")
@use_alias(
C="single_form",
D="duplicate",
E="quantity",
L="unit",
L="units",
N="node_table",
Q="voronoi",
)
Expand Down Expand Up @@ -85,7 +86,7 @@ def sphdistance(

Optionally, append the resampling interval along Voronoi arcs in
spherical degrees.
unit : str
units : str
Specify the unit used for distance calculations. Choose among **d**
(spherical degrees), **e** (meters), **f** (feet), **k** (kilometers),
**M** (miles), **n** (nautical miles), or **u** (survey feet).
Expand Down