Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
riku-sakamoto wants to merge2 commits intonumpy:main
base:main
Choose a base branch
Loading
fromriku-sakamoto:fix_atol_format_in_assert_allclose

Conversation

@riku-sakamoto
Copy link
Contributor

Closes#30382

The:g float formatting caused a TypeError whenatol was anumpy.timedelta64 scalar. This patch falls back to default string formatting fornumpy.timedelta64 scalar.

@riku-sakamotoriku-sakamotoforce-pushed thefix_atol_format_in_assert_allclose branch fromed7772e tocf001edCompareDecember 6, 2025 00:30
@jorenham
Copy link
Member

The two CI failures are unrelated, see#30385

riku-sakamoto reacted with thumbs up emoji

Copy link
Member

@jorenhamjorenham left a 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.

riku-sakamoto reacted with thumbs up emoji
@jorenhamjorenham changed the titleBUG: Fixassert_allclose to acceptnumpy.timedelta64 asatolENH: Changeassert_allclose to acceptnumpy.timedelta64 asatolDec 6, 2025
@riku-sakamotoriku-sakamotoforce-pushed thefix_atol_format_in_assert_allclose branch fromf75091e to3f840cfCompareDecember 6, 2025 02:49
@riku-sakamoto
Copy link
ContributorAuthor

From the discussion in#30385, it looks like the CI issue has been resolved.
Would it be alright if I rebase this branch to re-run the CI?

@jorenham
Copy link
Member

rebasing sounds good

riku-sakamoto reacted with thumbs up emoji

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)
@riku-sakamotoriku-sakamotoforce-pushed thefix_atol_format_in_assert_allclose branch from3f840cf toae79c9fCompareDecember 11, 2025 10:57
@github-actions
Copy link

Diff 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]

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@jorenhamjorenhamjorenham approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

BUG:np.testing.assert_allclose raisesValueError when usingtimedelta64 withatol

2 participants

@riku-sakamoto@jorenham

[8]ページ先頭

©2009-2025 Movatter.jp