-
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.
* move to local branch * fix array_api import at test_spec_elementwise_functions.py * adding _wrapper in ceil function at _spec_elementwise_functions.py * implementing a wrapper to fix test errors * fixing import, trying ceil & floor w\o wrapper * pre-commit fixes * reverting wrapper removal in floor and ceil * fixing lower bound in the same PR * fixing test errors for numpy 1.22 * skip wrapping of dtype in numpy 1 * adding helper file & floor, ceil tests for numpy 1 changes * pre-commit changes * fix: cleanup * fix: prettyprint * fix: pin numpy to a stable version for now * revert changes * fix: fix to numpy 2.0 stable version * fix: ensure compatibility with numpy 2.0.0 * fix: pre-commit * fix: numpy version --------- Co-authored-by: ohrechykha <[email protected]>
- Loading branch information
1 parent
fff5354
commit a83deb4
Showing
5 changed files
with
89 additions
and
18 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,20 @@ | ||
# BSD 3-Clause License; see https://github.com/scikit-hep/ragged/blob/main/LICENSE | ||
from __future__ import annotations | ||
|
||
import numpy as np | ||
|
||
|
||
def regularise_to_float(t: np.dtype, /) -> np.dtype: | ||
# Ensure compatibility with numpy 2.0.0 | ||
if np.__version__ >= "2.1": | ||
# Just pass and return the input type if the numpy version is not 2.0.0 | ||
return t | ||
|
||
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
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