Skip to content

Commit

Permalink
Add partial type hints support to load_earth_relief
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Nov 15, 2023
1 parent 6ae2072 commit cc6c461
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pygmt/datasets/earth_relief.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
The grids are available in various resolutions.
"""
from collections.abc import Sequence
from typing import Literal, Union

from pygmt.datasets.load_remote_dataset import _load_remote_dataset
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import kwargs_to_strings
Expand All @@ -14,9 +17,9 @@
@kwargs_to_strings(region="sequence")
def load_earth_relief(
resolution="01d",
region=None,
registration=None,
data_source="igpp",
region: Union[str, Sequence, None] = None,
registration: Literal["gridline", "pixel", None] = None,
data_source: Literal["igpp", "gebco", "gebcosi", "synbath"] = "igpp",
use_srtm=False,
):
r"""
Expand Down Expand Up @@ -63,18 +66,18 @@ def load_earth_relief(
``"04m"``, ``"03m"``, ``"02m"``, ``"01m"``, ``"30s"``, ``"15s"``,
``"03s"``, or ``"01s"``.
region : str or list
region
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 Earth relief grids with resolutions higher than 5
arc-minutes (i.e., ``"05m"``).
registration : str
registration
Grid registration type. Either ``"pixel"`` for pixel registration or
``"gridline"`` for gridline registration. Default is ``"gridline"``
for all resolutions except ``"15s"`` which is ``"pixel"`` only.
data_source : str
data_source
Select the source for the Earth relief data. Available options are:
- ``"igpp"``: IGPP Earth Relief [Default option]. See
Expand Down

0 comments on commit cc6c461

Please sign in to comment.