Skip to content

Commit 21451a8

Browse files
authored
Merge pull request #257 from TGSAI/bug/coord_to_index_cast
Cast `coord_to_index` return type to `uint32` for larger ranges
2 parents 38c9deb + 0ea0644 commit 21451a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mdio/api/accessor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def coord_to_index(
497497

498498
sorter = mdio_dim.coords.argsort()
499499
dim_idx = np.searchsorted(mdio_dim, dim_query_coords, sorter=sorter)
500-
dim_idx = dim_idx.astype("uint16") # cast to minimize memory. max: 65,535
500+
dim_idx = dim_idx.astype("uint32") # cast max: 2,147,483,647
501501
dim_indices += (dim_idx,)
502502

503503
return dim_indices if len(dim_indices) > 1 else dim_indices[0]

0 commit comments

Comments
 (0)