Skip to content

Commit e67addd

Browse files
authored
Fix the typing hints for grd2xyz (#3560)
1 parent 4b1c9ac commit e67addd

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pygmt/src/grd2xyz.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
grd2xyz - Convert grid to data table
33
"""
44

5-
from typing import TYPE_CHECKING, Literal
5+
from typing import Literal
66

77
import numpy as np
88
import pandas as pd
@@ -17,9 +17,6 @@
1717
validate_output_table_type,
1818
)
1919

20-
if TYPE_CHECKING:
21-
from collections.abc import Hashable
22-
2320
__doctest_skip__ = ["grd2xyz"]
2421

2522

@@ -152,11 +149,11 @@ def grd2xyz(
152149
)
153150

154151
# Set the default column names for the pandas dataframe header.
155-
column_names: list[Hashable] = ["x", "y", "z"]
152+
column_names: list[str] = ["x", "y", "z"]
156153
# Let output pandas column names match input DataArray dimension names
157154
if output_type == "pandas" and isinstance(grid, xr.DataArray):
158155
# Reverse the dims because it is rows, columns ordered.
159-
column_names = [grid.dims[1], grid.dims[0], grid.name]
156+
column_names = [str(grid.dims[1]), str(grid.dims[0]), str(grid.name)]
160157

161158
with Session() as lib:
162159
with (

0 commit comments

Comments
 (0)