Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Allow unmodified use of isclose, allclose, etc. with timedelta #18329

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

seberg
Copy link
Member

@seberg seberg commented Feb 4, 2021

Disallowing timedelta64+float promotion (to timedelta64) in all cases
(previously it was assymetric and "half allowed") meant that isclose,
allclose, np.ma.allclose, and assert_arrays_almost_equal (which uses
isclose), would stop work for timedelta64. Hardcoding that timedelta64
is passed on unmodified retains the old behaviour.

It may make sense to deprecate or change this behaviour in the future,
but for the 1.20 release, the behaviour should be as much unmodified
as possible.

Closes gh-18286

@seberg seberg added 06 - Regression 09 - Backport-Candidate PRs tagged should be backported labels Feb 4, 2021
@seberg seberg added this to the 1.20.1 release milestone Feb 4, 2021
Disallowing timedelta64+float promotion (to timedelta64) in all cases
(previously it was assymetric and "half allowed") meant that isclose,
allclose, np.ma.allclose, and assert_arrays_almost_equal (which uses
isclose), would stop work for timedelta64. Hardcoding that timedelta64
is passed on unmodified retains the old behaviour.

It may make sense to deprecate or change this behaviour in the future,
but for the 1.20 release, the behaviour should be as much unmodified
as possible.

Closes numpygh-18286
@charris charris merged commit 6373ded into numpy:master Feb 5, 2021
@charris
Copy link
Member

charris commented Feb 5, 2021

Thanks Sebastian.

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Feb 5, 2021
@charris charris removed this from the 1.20.1 release milestone Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

assert_allclose stopped working for timedelta64 in version 1.20
2 participants