Skip to content

Commit

Permalink
Merge pull request #729 from HEXRD/gridutil-warning-supression
Browse files Browse the repository at this point in the history
cast only non-nan numbers to integers.
  • Loading branch information
saransh13 authored Nov 15, 2024
2 parents ff0a76e + c73a96e commit ba52e1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hexrd/gridutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def cellIndices(edges, points_1d):
# idx[off_lo] = np.nan
# if np.any(off_hi):
# idx[off_hi] = np.nan
return np.array(idx, dtype=int)
idx[np.isnan(idx)] = -1
return idx.astype(int)


@numba.njit(nogil=True, cache=True)
Expand Down

0 comments on commit ba52e1a

Please sign in to comment.