-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding helper file & floor, ceil tests for numpy 1 changes
- Loading branch information
1 parent
ce6af43
commit a567704
Showing
3 changed files
with
26 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# BSD 3-Clause License; see https://github.com/scikit-hep/ragged/blob/main/LICENSE | ||
|
||
import numpy as np | ||
|
||
def regularise_to_float(t: np.dtype, /) -> np.dtype: | ||
if t in [np.int8, np.uint8, np.bool_, bool]: | ||
return np.float16 | ||
elif t in [np.int16, np.uint16]: | ||
return np.float32 | ||
elif t in [np.int32, np.uint32, np.int64, np.uint64]: | ||
return np.float64 | ||
else: | ||
return t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters