Skip to content

Commit d139544

Browse files
Make arguments for 'direction' parameter readable
1 parent 294368f commit d139544

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pygmt/datasets/earth_deflection.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ def load_earth_deflection(
2020
] = "01d",
2121
region: Sequence[float] | str | None = None,
2222
registration: Literal["gridline", "pixel", None] = None,
23-
direction: Literal["edefl", "ndefl"] = "edefl",
23+
direction: Literal["east_west", "south_north"] = "east_west",
2424
) -> xr.DataArray:
2525
r"""
26-
Load the IGPP Earth east-west and south-north deflections datasets in various
26+
Load the IGPP Earth east-west and south-north deflection datasets in various
2727
resolutions.
2828
2929
.. list-table::
@@ -71,8 +71,8 @@ def load_earth_deflection(
7171
``"gridline"`` for gridline registration. Default is ``None``, means
7272
``"gridline"`` for all resolutions except ``"01m"`` which is ``"pixel"`` only.
7373
direction
74-
By default, the east-west deflection (``direction="edefl"``) is returned, set
75-
``direction="ndefl"`` to return the south-north deflection.
74+
By default, the east-west deflection (``direction="east_west"``) is returned,
75+
``direction="south_north"`` to return the south-north deflection.
7676
7777
Returns
7878
-------
@@ -106,7 +106,7 @@ def load_earth_deflection(
106106
... resolution="05m", region=[120, 160, 30, 60], registration="gridline"
107107
... )
108108
"""
109-
prefix = "earth_ndefl" if direction == "ndefl" else "earth_edefl"
109+
prefix = "earth_ndefl" if direction == "south_north" else "earth_edefl"
110110
grid = _load_remote_dataset(
111111
name=prefix,
112112
prefix=prefix,

pygmt/tests/test_datasets_earth_deflection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_earth_ndefl_01d():
5959
"""
6060
Test some properties of the Earth south-north deflection 01d data.
6161
"""
62-
data = load_earth_deflection(resolution="01d", direction="ndefl")
62+
data = load_earth_deflection(resolution="01d", direction="south_north")
6363
assert data.name == "z"
6464
assert data.attrs["long_name"] == "ndefl (microradians)"
6565
assert data.attrs["description"] == "IGPP Earth south-north deflection"
@@ -78,7 +78,7 @@ def test_earth_ndefl_01d_with_region():
7878
Test loading low-resolution Earth south-north deflection with "region".
7979
"""
8080
data = load_earth_deflection(
81-
resolution="01d", region=[-10, 10, -5, 5], direction="ndefl"
81+
resolution="01d", region=[-10, 10, -5, 5], direction="south_north"
8282
)
8383
assert data.shape == (11, 21)
8484
assert data.gmt.registration == 0
@@ -94,7 +94,7 @@ def test_earth_ndefl_01m_default_registration():
9494
registration.
9595
"""
9696
data = load_earth_deflection(
97-
resolution="01m", region=[-10, -9, 3, 5], direction="ndefl"
97+
resolution="01m", region=[-10, -9, 3, 5], direction="south_north"
9898
)
9999
assert data.shape == (120, 60)
100100
assert data.gmt.registration == 1

0 commit comments

Comments
 (0)