Skip to content

Commit

Permalink
Small typo fixes and add output type-hint for to_dataarray
Browse files Browse the repository at this point in the history
  • Loading branch information
weiji14 committed Jun 18, 2024
1 parent f71e79c commit 4cce4a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pygmt/datatypes/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ class _GMT_IMAGE(ctp.Structure): # noqa: N801
("hidden", ctp.c_void_p),
]

def to_dataarray(self):
def to_dataarray(self) -> xr.DataArray:
"""
Convert a _GMT_GRID object to an :class:`xarray.DataArray` object.
Convert a _GMT_IMAGE object to an :class:`xarray.DataArray` object.
Returns
-------
dataarray
A :class:`xarray.DataArray` object.
"""

# Get grid header
# Get image header
header: _GMT_GRID_HEADER = self.header.contents

Check warning on line 83 in pygmt/datatypes/image.py

View check run for this annotation

Codecov / codecov/patch

pygmt/datatypes/image.py#L83

Added line #L83 was not covered by tests

# Get DataArray without padding
Expand Down

0 comments on commit 4cce4a2

Please sign in to comment.