Skip to content

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

Merged
charris merged 1 commit intonumpy:maintenance/1.20.xfrom
charris:backport-18329
Feb 5, 2021
Merged

BUG: Allow unmodified use of isclose, allclose, etc. with timedelta#18337
charris merged 1 commit intonumpy:maintenance/1.20.xfrom
charris:backport-18329

Conversation

@charris
Copy link
Copy Markdown
Member

@charris charris commented Feb 5, 2021

Backport of #18329.

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants