Skip to content

Commit ba52e1a

Browse files
authored
Merge pull request #729 from HEXRD/gridutil-warning-supression
cast only non-nan numbers to integers.
2 parents ff0a76e + c73a96e commit ba52e1a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hexrd/gridutil.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ def cellIndices(edges, points_1d):
8787
# idx[off_lo] = np.nan
8888
# if np.any(off_hi):
8989
# idx[off_hi] = np.nan
90-
return np.array(idx, dtype=int)
90+
idx[np.isnan(idx)] = -1
91+
return idx.astype(int)
9192

9293

9394
@numba.njit(nogil=True, cache=True)

0 commit comments

Comments
 (0)