Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork11.9k
ENH: Changeassert_allclose to acceptnumpy.timedelta64 asatol#30386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
ENH: Changeassert_allclose to acceptnumpy.timedelta64 asatol#30386
Conversation
ed7772e tocf001edComparejorenham commentedDec 6, 2025
The two CI failures are unrelated, see#30385 |
jorenham left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Since the docs did not mention thatatol supportsnp.timedelta64 , I think it would be more appropriate to consider this to be an enhancement, rather than a bugfix.
I can see how this would be handy to have, and the changes are subtle enough. So this is a +1 for me.
Uh oh!
There was an error while loading.Please reload this page.
assert_allclose to acceptnumpy.timedelta64 asatolassert_allclose to acceptnumpy.timedelta64 asatolf75091e to3f840cfCompareriku-sakamoto commentedDec 11, 2025
From the discussion in#30385, it looks like the CI issue has been resolved. |
jorenham commentedDec 11, 2025
rebasing sounds good |
The `:g` float formatting caused a TypeError when `atol` was a`numpy.timedelta64` scalar. This patch falls back to default stringformatting for `numpy.timedelta64` scalar. (Seenumpy#30382)
3f840cf toae79c9fCompareDiff frommypy_primer, showing the effect of this PR on type check results on a corpus of open source code: pandas (https://github.com/pandas-dev/pandas)- /home/runner/work/numpy/numpy/numpy_base/numpy/__init__.pyi:732: error: Type statement is only supported in Python 3.12 and greater [syntax]+ /home/runner/work/numpy/numpy/numpy_to_test/numpy/__init__.pyi:732: error: Type statement is only supported in Python 3.12 and greater [syntax] |
Closes#30382
The
:gfloat formatting caused a TypeError whenatolwas anumpy.timedelta64scalar. This patch falls back to default string formatting fornumpy.timedelta64scalar.