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

pygmt.datasets.load_*: Add autocompletion support for the 'resolution' parameter #3260

Merged
merged 4 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all 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/earth_age.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

@kwargs_to_strings(region="sequence")
def load_earth_age(
resolution="01d",
resolution: Literal[
"01d", "30m", "20m", "15m", "10m", "06m", "05m", "04m", "03m", "02m", "01m"
] = "01d",
region=None,
registration: Literal["gridline", "pixel"] = "gridline",
):
Expand Down Expand Up @@ -51,11 +53,9 @@ def load_earth_age(

Parameters
----------
resolution : str
The grid resolution. The suffix ``d`` and ``m`` stand for
arc-degrees and arc-minutes. It can be ``"01d"``, ``"30m"``,
``"20m"``, ``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``, ``"04m"``,
``"03m"``, ``"02m"``, or ``"01m"``.
resolution
The grid resolution. The suffix ``d`` and ``m`` stand for arc-degrees and
arc-minutes.

region : str or list
The subregion of the grid to load, in the form of a list
Expand Down
12 changes: 6 additions & 6 deletions pygmt/datasets/earth_free_air_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

@kwargs_to_strings(region="sequence")
def load_earth_free_air_anomaly(
resolution="01d",
resolution: Literal[
"01d", "30m", "20m", "15m", "10m", "06m", "05m", "04m", "03m", "02m", "01m"
] = "01d",
region=None,
registration: Literal["gridline", "pixel", None] = None,
):
Expand Down Expand Up @@ -51,11 +53,9 @@ def load_earth_free_air_anomaly(

Parameters
----------
resolution : str
The grid resolution. The suffix ``d`` and ``m`` stand for
arc-degrees and arc-minutes. It can be ``"01d"``, ``"30m"``,
``"20m"``, ``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``, ``"04m"``,
``"03m"``, ``"02m"``, or ``"01m"``.
resolution
The grid resolution. The suffix ``d`` and ``m`` stand for arc-degrees and
arc-minutes.

region : str or list
The subregion of the grid to load, in the form of a list
Expand Down
12 changes: 6 additions & 6 deletions pygmt/datasets/earth_geoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

@kwargs_to_strings(region="sequence")
def load_earth_geoid(
resolution="01d",
resolution: Literal[
"01d", "30m", "20m", "15m", "10m", "06m", "05m", "04m", "03m", "02m", "01m"
] = "01d",
region=None,
registration: Literal["gridline", "pixel"] = "gridline",
):
Expand Down Expand Up @@ -44,11 +46,9 @@ def load_earth_geoid(

Parameters
----------
resolution : str
The grid resolution. The suffix ``d`` and ``m`` stand for
arc-degrees and arc-minutes. It can be ``"01d"``, ``"30m"``,
``"20m"``, ``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``, ``"04m"``,
``"03m"``, ``"02m"``, or ``"01m"``.
resolution
The grid resolution. The suffix ``d`` and ``m`` stand for arc-degrees and
arc-minutes.

region : str or list
The subregion of the grid to load, in the form of a list
Expand Down
12 changes: 6 additions & 6 deletions pygmt/datasets/earth_magnetic_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

@kwargs_to_strings(region="sequence")
def load_earth_magnetic_anomaly(
resolution="01d",
resolution: Literal[
"01d", "30m", "20m", "15m", "10m", "06m", "05m", "04m", "03m", "02m"
] = "01d",
region=None,
registration: Literal["gridline", "pixel", None] = None,
data_source: Literal["emag2", "emag2_4km", "wdmam"] = "emag2",
Expand Down Expand Up @@ -64,11 +66,9 @@ def load_earth_magnetic_anomaly(

Parameters
----------
resolution : str
The grid resolution. The suffix ``d`` and ``m`` stand for
arc-degrees and arc-minutes. It can be ``"01d"``, ``"30m"``,
``"20m"``, ``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``, ``"04m"``,
``"03m"``, or ``"02m"``. The ``"02m"`` resolution is not available for
resolution
The grid resolution. The suffix ``d`` and ``m`` stand for arc-degrees and
arc-minutes. The resolution ``"02m"`` is not available for
``data_source="wdmam"``.

region : str or list
Expand Down
24 changes: 18 additions & 6 deletions pygmt/datasets/earth_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@

@kwargs_to_strings(region="sequence")
def load_earth_mask(
resolution="01d",
resolution: Literal[
"01d",
"30m",
"20m",
"15m",
"10m",
"06m",
"05m",
"04m",
"03m",
"02m",
"01m",
"30s",
"15s",
] = "01d",
region=None,
registration: Literal["gridline", "pixel"] = "gridline",
):
Expand Down Expand Up @@ -44,11 +58,9 @@ def load_earth_mask(

Parameters
----------
resolution : str
The grid resolution. The suffix ``d``, ``m``, and ``s`` stand for
arc-degrees, arc-minutes, and arc-seconds. It can be ``"01d"``,
``"30m"``, ``"20m"``, ``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``,
``"04m"``, ``"03m"``, ``"02m"``, ``"01m"``, ``"30s"``, or ``"15s"``.
resolution
The grid resolution. The suffix ``d``, ``m``, and ``s`` stand for arc-degrees,
arc-minutes, and arc-seconds.

region : str or list
The subregion of the grid to load, in the form of a list
Expand Down
27 changes: 20 additions & 7 deletions pygmt/datasets/earth_relief.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,23 @@

@kwargs_to_strings(region="sequence")
def load_earth_relief(
resolution="01d",
resolution: Literal[
"01d",
"30m",
"20m",
"15m",
"10m",
"06m",
"05m",
"04m",
"03m",
"02m",
"01m",
"30s",
"15s",
"03s",
"01s",
] = "01d",
seisman marked this conversation as resolved.
Show resolved Hide resolved
region=None,
registration: Literal["gridline", "pixel", None] = None,
data_source: Literal["igpp", "gebco", "gebcosi", "synbath"] = "igpp",
Expand Down Expand Up @@ -58,12 +74,9 @@ def load_earth_relief(

Parameters
----------
resolution : str
The grid resolution. The suffix ``d``, ``m`` and ``s`` stand for
arc-degrees, arc-minutes, and arc-seconds. It can be ``"01d"``,
``"30m"``, ``"20m"``, ``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``,
``"04m"``, ``"03m"``, ``"02m"``, ``"01m"``, ``"30s"``, ``"15s"``,
``"03s"``, or ``"01s"``.
resolution
The grid resolution. The suffix ``d``, ``m`` and ``s`` stand for arc-degrees,
arc-minutes, and arc-seconds.

region : str or list
The subregion of the grid to load, in the form of a list
Expand Down
12 changes: 6 additions & 6 deletions pygmt/datasets/earth_vertical_gravity_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

@kwargs_to_strings(region="sequence")
def load_earth_vertical_gravity_gradient(
resolution="01d",
resolution: Literal[
"01d", "30m", "20m", "15m", "10m", "06m", "05m", "04m", "03m", "02m", "01m"
] = "01d",
region=None,
registration: Literal["gridline", "pixel", None] = None,
):
Expand Down Expand Up @@ -51,11 +53,9 @@ def load_earth_vertical_gravity_gradient(

Parameters
----------
resolution : str
The grid resolution. The suffix ``d`` and ``m`` stand for
arc-degrees and arc-minutes. It can be ``"01d"``, ``"30m"``,
``"20m"``, ``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``, ``"04m"``,
``"03m"``, ``"02m"``, or ``"01m"``.
resolution
The grid resolution. The suffix ``d`` and ``m`` stand for arc-degrees and
arc-minutes.

region : str or list
The subregion of the grid to load, in the form of a list
Expand Down
23 changes: 18 additions & 5 deletions pygmt/datasets/mars_relief.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,22 @@

@kwargs_to_strings(region="sequence")
def load_mars_relief(
resolution="01d",
resolution: Literal[
"01d",
"30m",
"20m",
"15m",
"10m",
"06m",
"05m",
"04m",
"03m",
"02m",
"01m",
"30s",
"15s",
"12s",
] = "01d",
region=None,
registration: Literal["gridline", "pixel", None] = None,
):
Expand Down Expand Up @@ -50,11 +65,9 @@ def load_mars_relief(

Parameters
----------
resolution : str
resolution
The grid resolution. The suffix ``d``, ``m`` and ``s`` stand for arc-degrees,
arc-minutes and arc-seconds. It can be ``"01d"``, ``"30m"``, ``"20m"``,
``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``, ``"04m"``, ``"03m"``, ``"02m"``,
``"01m"``, ``"30s"``, ``"15s"``, and ``"12s"``.
arc-minutes and arc-seconds.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*. Required for
Expand Down
21 changes: 16 additions & 5 deletions pygmt/datasets/mercury_relief.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@

@kwargs_to_strings(region="sequence")
def load_mercury_relief(
resolution="01d",
resolution: Literal[
"01d",
"30m",
"20m",
"15m",
"10m",
"06m",
"05m",
"04m",
"03m",
"02m",
"01m",
"56s",
] = "01d",
region=None,
registration: Literal["gridline", "pixel", None] = None,
):
Expand Down Expand Up @@ -50,11 +63,9 @@ def load_mercury_relief(

Parameters
----------
resolution : str
resolution
The grid resolution. The suffix ``d``, ``m`` and ``s`` stand for arc-degrees,
arc-minutes and arc-seconds. It can be ``"01d"``, ``"30m"``, ``"20m"``,
``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``, ``"04m"``, ``"03m"``, ``"02m"``,
``"01m"``, and ``"56s"``.
arc-minutes and arc-seconds.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*. Required for
Expand Down
23 changes: 18 additions & 5 deletions pygmt/datasets/moon_relief.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,22 @@

@kwargs_to_strings(region="sequence")
def load_moon_relief(
resolution="01d",
resolution: Literal[
"01d",
"30m",
"20m",
"15m",
"10m",
"06m",
"05m",
"04m",
"03m",
"02m",
"01m",
"30s",
"15s",
"14s",
] = "01d",
region=None,
registration: Literal["gridline", "pixel", None] = None,
):
Expand Down Expand Up @@ -50,11 +65,9 @@ def load_moon_relief(

Parameters
----------
resolution : str
resolution
The grid resolution. The suffix ``d``, ``m`` and ``s`` stand for arc-degrees,
arc-minutes and arc-seconds. It can be ``"01d"``, ``"30m"``, ``"20m"``,
``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``, ``"04m"``, ``"03m"``, ``"02m"``,
``"01m"``, ``"30s"``, ``"15s"``, and ``"14s"``.
arc-minutes and arc-seconds.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*. Required for
Expand Down
21 changes: 16 additions & 5 deletions pygmt/datasets/pluto_relief.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@

@kwargs_to_strings(region="sequence")
def load_pluto_relief(
resolution="01d",
resolution: Literal[
"01d",
"30m",
"20m",
"15m",
"10m",
"06m",
"05m",
"04m",
"03m",
"02m",
"01m",
"52s",
] = "01d",
region=None,
registration: Literal["gridline", "pixel", None] = None,
):
Expand Down Expand Up @@ -50,11 +63,9 @@ def load_pluto_relief(

Parameters
----------
resolution : str
resolution
The grid resolution. The suffix ``d``, ``m`` and ``s`` stand for arc-degrees,
arc-minutes and arc-seconds. It can be ``"01d"``, ``"30m"``, ``"20m"``,
``"15m"``, ``"10m"``, ``"06m"``, ``"05m"``, ``"04m"``, ``"03m"``, ``"02m"``,
``"01m"``, and ``"52s"``.
arc-minutes and arc-seconds.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*. Required for
Expand Down
9 changes: 5 additions & 4 deletions pygmt/datasets/venus_relief.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

@kwargs_to_strings(region="sequence")
def load_venus_relief(
resolution="01d",
resolution: Literal[
"01d", "30m", "20m", "15m", "10m", "06m", "05m", "04m", "03m", "02m", "01m"
] = "01d",
region=None,
registration: Literal["gridline", "pixel"] = "gridline",
):
Expand Down Expand Up @@ -50,10 +52,9 @@ def load_venus_relief(

Parameters
----------
resolution : str
resolution
The grid resolution. The suffix ``d`` and ``m`` stand for arc-degrees and
arc-minutes. It can be ``"01d"``, ``"30m"``, ``"20m"``, ``"15m"``, ``"10m"``,
``"06m"``, ``"05m"``, ``"04m"``, ``"03m"``, ``"02m"``, and ``"01m"``.
arc-minutes.
region : str or list
The subregion of the grid to load, in the form of a list
[*xmin*, *xmax*, *ymin*, *ymax*] or a string *xmin/xmax/ymin/ymax*.
Expand Down
Loading