File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22grd2xyz - Convert grid to data table
33"""
44
5- from typing import TYPE_CHECKING , Literal
5+ from typing import Literal
66
77import numpy as np
88import pandas as pd
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 (
You can’t perform that action at this time.
0 commit comments