Skip to content

Commit 28104d3

Browse files
committed
utils: Force return of integers from get_index_of_nearest_node()
Printing the index node was kind of problematic.
1 parent e2f667f commit 28104d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

thalassa/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def get_index_of_nearest_node(ds: xr.Dataset, lon: float, lat: float) -> int:
161161
# https://www.unidata.ucar.edu/blogs/developer/en/entry/accessing_netcdf_data_by_coordinates
162162
# https://github.com/Unidata/python-workshop/blob/fall-2016/notebooks/netcdf-by-coordinates.ipynb
163163
dist = abs(ds.lon - lon) ** 2 + abs(ds.lat - lat) ** 2
164-
index_of_nearest_node = T.cast(int, dist.argmin())
164+
index_of_nearest_node = int(dist.argmin())
165165
return index_of_nearest_node
166166

167167

0 commit comments

Comments
 (0)