Skip to content

EHN: Add support for vector atol and rtol in np.all_isclose and np…#14343

Closed
maxwell-aladago wants to merge 5 commits intonumpy:mainfrom
maxwell-aladago:is_close
Closed

EHN: Add support for vector atol and rtol in np.all_isclose and np…#14343
maxwell-aladago wants to merge 5 commits intonumpy:mainfrom
maxwell-aladago:is_close

Conversation

@maxwell-aladago
Copy link
Contributor

@maxwell-aladago maxwell-aladago commented Aug 23, 2019

Fixes #14320.

@charris charris changed the title EHN: adding support for vector atol and rtol in np.all_isclose and np… EHN: Add support for vector atol and rtol in np.all_isclose and np… Aug 23, 2019
@charris
Copy link
Member

charris commented Aug 23, 2019

Fixes #14320.

@charris
Copy link
Member

charris commented Aug 23, 2019

Needs a release note.

@maxwell-aladago
Copy link
Contributor Author

@charris, will this be ok for a release note?

Vector ``atol`` and ``rtol`` in ``np.all_isclose`` and ``np.isclose``
-----------------------------------------------------------------------
The keywords ``atol`` and ``rtol`` in ``np.isclose`` and ``np.all_isclose`` 
now accept both scalars and vectors. A vector if given must have the same 
length as the larger of the two input arrays ``x`` and ``y``. 

@maxwell-aladago
Copy link
Contributor Author

By the way, the component is numpy.core, not numpy.testing

@mattip
Copy link
Member

mattip commented Dec 19, 2019

@eric-wieser, @shoyer any more comments?

Base automatically changed from master to main March 4, 2021 02:04
@InessaPawson InessaPawson added the triage review Issue/PR to be discussed at the next triage meeting label Jun 9, 2022
@charris
Copy link
Member

charris commented Jun 15, 2022

close/reopen

@charris charris closed this Jun 15, 2022
@charris charris reopened this Jun 15, 2022
@mattip
Copy link
Member

mattip commented Jun 15, 2022

Is there a clear use case for this? I feel it is a bit too complicated to have non-scalar atol/rtol.

@mattip mattip closed this Jun 15, 2022
@mattip
Copy link
Member

mattip commented Jun 15, 2022

If you disagree feel free to reopen. Please also describe the use case in the mailing list since this is an enhancement request.

@InessaPawson InessaPawson added triaged Issue/PR that was discussed in a triage meeting and removed triage review Issue/PR to be discussed at the next triage meeting labels Jun 15, 2022
@InessaPawson InessaPawson removed the triaged Issue/PR that was discussed in a triage meeting label Jun 15, 2022
@Toefinder
Copy link

Is there a clear use case for this? I feel it is a bit too complicated to have non-scalar atol/rtol.

I've described a use case for this in this issue comment. Basically, if we want to ensure two vectors, but we want the absolute tolerances for some axes to be different from the absolute tolerances for other axes.

@mattip
Copy link
Member

mattip commented Mar 26, 2023

Could you write to numpy-discussion proposing the enhancement?

@mattip mattip reopened this Mar 26, 2023
@Toefinder
Copy link

Could you write to numpy-discussion proposing the enhancement?

I've submitted a thread to the discussion. But it is not showing up yet. I'm quite new to this. Do I have to wait for the thread to be approved by moderators?

@seberg
Copy link
Member

seberg commented May 17, 2023

Anyone want to finish this up? A new PR would also be fine. The docs are slightly off, there is no all_isclose function and since I doubt it is super common, maybe we should keep the scalar case and only do ?tol[finite] (i.e. the indexing) when it isn't scalar?

@mattip
Copy link
Member

mattip commented Jul 3, 2024

Closing, #24878 is a duplicate and was merged. Thanks @maxwell-aladago anyway.

@mattip mattip closed this Jul 3, 2024
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.

allclose() vector atol parameter wrong shape if NaN in a or b.

8 participants