Skip to content

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

Merged
charris merged 1 commit intonumpy:masterfrom
seberg:issue-18286
Feb 5, 2021
Merged

BUG: Allow unmodified use of isclose, allclose, etc. with timedelta#18329
charris merged 1 commit intonumpy:masterfrom
seberg:issue-18286

Conversation

@seberg
Copy link
Copy Markdown
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
Copy Markdown
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