Skip to content
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

Remote Datasets: Use complete word for units in "load_remote_dataset" and related tests #3725

Merged
merged 5 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
12 changes: 6 additions & 6 deletions pygmt/datasets/load_remote_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class GMTRemoteDataset(NamedTuple):
datasets = {
"earth_age": GMTRemoteDataset(
description="EarthByte Earth seafloor crustal age",
units="Myr",
units="million years",
Copy link
Member

Choose a reason for hiding this comment

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

I don't think "million years" are valid units.

Let's focus on "meters" vs "m" in this PR.

Copy link
Member Author

@yvonnefroehlich yvonnefroehlich Dec 26, 2024

Choose a reason for hiding this comment

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

Yes! I was unsure with the crustal age dataset. Also have a preference to keep Myr.
See commit 676ece8 for the update.

extra_attributes={"horizontal_datum": "WGS84"},
resolutions={
"01d": Resolution("01d"),
Expand Down Expand Up @@ -94,7 +94,7 @@ class GMTRemoteDataset(NamedTuple):
),
"earth_dist": GMTRemoteDataset(
description="GSHHG Earth distance to shoreline",
units="km",
units="kilometers",
extra_attributes={"horizontal_datum": "WGS84"},
resolutions={
"01d": Resolution("01d"),
Expand All @@ -112,7 +112,7 @@ class GMTRemoteDataset(NamedTuple):
),
"earth_faa": GMTRemoteDataset(
description="IGPP Earth free-air anomaly",
units="mGal",
units="milli Gal",
extra_attributes={"horizontal_datum": "WGS84"},
resolutions={
"01d": Resolution("01d"),
Expand Down Expand Up @@ -152,7 +152,7 @@ class GMTRemoteDataset(NamedTuple):
),
"earth_geoid": GMTRemoteDataset(
description="EGM2008 Earth geoid",
units="m",
units="meters",
extra_attributes={"horizontal_datum": "WGS84"},
resolutions={
"01d": Resolution("01d"),
Expand Down Expand Up @@ -192,7 +192,7 @@ class GMTRemoteDataset(NamedTuple):
),
"earth_mag": GMTRemoteDataset(
description="EMAG2 Earth Magnetic Anomaly Model",
units="nT",
units="nano Tesla",
extra_attributes={"horizontal_datum": "WGS84"},
resolutions={
"01d": Resolution("01d"),
Expand Down Expand Up @@ -266,7 +266,7 @@ class GMTRemoteDataset(NamedTuple):
),
"earth_wdmam": GMTRemoteDataset(
description="WDMAM World Digital Magnetic Anomaly Map",
units="nT",
units="nano Tesla",
extra_attributes={"horizontal_datum": "WGS84"},
resolutions={
"01d": Resolution("01d"),
Expand Down
2 changes: 1 addition & 1 deletion pygmt/tests/test_datasets_earth_age.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_earth_age_01d():
assert data.name == "z"
assert data.attrs["long_name"] == "ages (Myr)"
assert data.attrs["description"] == "EarthByte Earth seafloor crustal age"
assert data.attrs["units"] == "Myr"
assert data.attrs["units"] == "million years"
assert data.attrs["horizontal_datum"] == "WGS84"
assert data.shape == (181, 361)
assert data.gmt.registration == 0
Expand Down
2 changes: 1 addition & 1 deletion pygmt/tests/test_datasets_earth_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_earth_dist_01d():
data = load_earth_dist(resolution="01d")
assert data.name == "z"
assert data.attrs["description"] == "GSHHG Earth distance to shoreline"
assert data.attrs["units"] == "km"
assert data.attrs["units"] == "kilometers"
assert data.attrs["horizontal_datum"] == "WGS84"
assert data.shape == (181, 361)
assert data.gmt.registration == 0
Expand Down
2 changes: 1 addition & 1 deletion pygmt/tests/test_datasets_earth_free_air_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_earth_faa_01d():
assert data.name == "z"
assert data.attrs["long_name"] == "faa (mGal)"
assert data.attrs["description"] == "IGPP Earth free-air anomaly"
assert data.attrs["units"] == "mGal"
assert data.attrs["units"] == "milli Gal"
assert data.attrs["horizontal_datum"] == "WGS84"
assert data.shape == (181, 361)
assert data.gmt.registration == 0
Expand Down
2 changes: 1 addition & 1 deletion pygmt/tests/test_datasets_earth_geoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_earth_geoid_01d():
assert data.name == "z"
assert data.attrs["long_name"] == "geoid (m)"
assert data.attrs["description"] == "EGM2008 Earth geoid"
assert data.attrs["units"] == "m"
assert data.attrs["units"] == "meters"
assert data.attrs["horizontal_datum"] == "WGS84"
assert data.shape == (181, 361)
assert data.gmt.registration == 0
Expand Down
4 changes: 2 additions & 2 deletions pygmt/tests/test_datasets_earth_magnetic_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_earth_mag_01d():
assert data.name == "z"
assert data.attrs["long_name"] == "anomaly (nT)"
assert data.attrs["description"] == "EMAG2 Earth Magnetic Anomaly Model"
assert data.attrs["units"] == "nT"
assert data.attrs["units"] == "nano Tesla"
assert data.attrs["horizontal_datum"] == "WGS84"
assert data.shape == (181, 361)
assert data.gmt.registration == 0
Expand Down Expand Up @@ -121,7 +121,7 @@ def test_earth_mag_01d_wdmam():
assert data.name == "z"
assert data.attrs["long_name"] == "anomaly (nT)"
assert data.attrs["description"] == "WDMAM World Digital Magnetic Anomaly Map"
assert data.attrs["units"] == "nT"
assert data.attrs["units"] == "nano Tesla"
assert data.attrs["horizontal_datum"] == "WGS84"
assert data.shape == (181, 361)
npt.assert_allclose(data.lat, np.arange(-90, 91, 1))
Expand Down
Loading