-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
DEP: Adopt *tol
deprecations also for gcrotmk/lgmres/minres/tfqmr
#19702
Conversation
numerous problems: various inconsistencies between warnings, spelling errors, f-strings not turned on, no explanation how to keep existing behaviour, etc.
very strange that this did not fail before already
…ings before returning
@ilayn @j-bowhay @tupui @mdhaber @andyfaff @lucascolley I'm fine with squash-merging this for the convenience of the backport, but just a quick explanation of the commits:
FYI @tylerjereddy |
*tol
deprecations also for gcrotmk/lgmres/minres/tfqmr
Diff looks good after a quick look through. I'll have a more detailed look later. |
@ilayn added
Your first commit changes from quote marks to backticks around |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall! Not familiar with this part of the codebase but the diff and your explanations make sense.
See the comment above this and the following. Non-blocking nits inline.
scipy/scipy/sparse/linalg/_isolve/tests/test_iterative.py
Lines 373 to 379 in c4ce0c4
# Historically this is tested as below, all pass but for some reason | |
# gcrotmk is over-sensitive to difference between random.seed/rng.random | |
# Hence tol lower bound is changed from -10 to -9 | |
# np.random.seed(1234) | |
# A = np.random.rand(10, 10) | |
# A = A @ A.T + 10 * np.eye(10) | |
# b = 1e3*np.random.rand(10) |
I don't completely understand this comment but I assume it shouldn't reference tol
anymore since the rest of the function doesn't.
Thanks for digging that up - I have a bit of a blindspot for blanket ignores (because I try to avoid them). IMO we should be dogfooding here and not hide those warnings, so I think we should keep 5ae5901. |
Yep, makes sense to remove the blanket ignore if no longer needed. |
as well as the format of the SciPy version for which we announce the change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just the comment left from #19702 (review) but not exactly blocking 😅
Yeah, I looked at this, there's nothing relevant to do here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for doing that @h-vetinari and thanks for the review @lucascolley 👍
* condensed backport of scipygh-19702 Co-authored-by: h-vetinari <h.vetinari@gmx.com>
This PR seems to have broken the pre-release CI job - not sure if directly or via a cross-merge conflict maybe. See e.g. this CI log from an hour ago, it has lots of failures like:
Would you having a look at that @h-vetinari? |
I'm confused as to why CI only |
@rgommers new |
|
Aha found it
I'll open a new issue |
Yeah, this is a case where we're warning both on positional use, as well as using It looks like the best way to deal with this IMO would be just to expand the match-pattern with a |
I suppose the alternative is to have two separate tests, filtering out one of the warnings in each. |
Aside from the syntactic overhead and code duplication, this is pointless IMO because those warnings can never be raised separately. Using positional |
#19806. It's a quick fix, but should be OK for now (even for backporting; though I ask not to squash-merge that PR). Alternative would of course be to just limit to |
While #18488 solved most of #15738, it left out
gcrotmk
/lgmres
/minres
/tfqmr
, which are defined differently (in python directly).Make the deprecation work around tol/atol/rtol uniform for those functions, which otherwise have the same interface.
Marked as a backport because IMO the current status is quite broken (including some of the warning text, see first commit).
This is an alternative to #16050, which does a more aggressive switch (requiring float
atol
directly) that we didn't do for the otherscipy.sparse.linalg.*
functions.Closes #15738