-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
DEP: switch sparse methods to kwarg-only; remove tol/restrt kwargs #20498
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
Conversation
ce87c83
to
e7d8579
Compare
fae34bd
to
19e66ab
Compare
19e66ab
to
5f192c6
Compare
def bicgstab(A, b, x0=None, *, rtol=1e-5, atol=0., maxiter=None, M=None, | ||
callback=None): |
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.
Note that x0
was falsely marked as kwarg-only here; it was missed by 6476f8a
... as well as more complex warning specifications, e.g. `ignore:match_msg` or `ignore::DeprecationWarning`.
@@ -621,6 +633,7 @@ def test_basic(self): | |||
|
|||
assert_allclose(x_gm[0], 0.359, rtol=1e-2) | |||
|
|||
@pytest.mark.filterwarnings(f"ignore:{CB_TYPE_FILTER}:DeprecationWarning") |
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.
match node.args[0]: | ||
case ast.Constant() as c: |
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.
Since we dropped 3.9 in #20373, I'm assuming that match:
statements are now fair game.
scipy/_lib/tests/test_warnings.py
Outdated
case _: | ||
raise ValueError("unknown ast node type") | ||
# check if filter is set to ignore | ||
if argtext.split(":")[0] == "ignore": |
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.
Guess I shouldn't have taught the parser here to be smarter about finding ignored warnings. It finds quite a few of them now 😅
Probably worth splitting this off into a separate PR...
@@ -724,6 +737,7 @@ def test_defective_matrix_breakdown(self): | |||
# The solution should be OK outside null space of A | |||
assert_allclose(A @ (A @ x), A @ b) | |||
|
|||
@pytest.mark.filterwarnings(f"ignore:{CB_TYPE_FILTER}:DeprecationWarning") |
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.
OTOH, I find this line much nicer than (as the failing test tells me to) indenting almost the whole test another level to wrap it in numpy.testing.suppress_warnings
(resp. pytest.warns
), or adding it 4x for the individual gmres
calls.
I see the mouse-over text for
needs-work
|
I've thought about this a bit while triaging first-time contributor PRs. I wouldn't be opposed to a So I propose we change the mouse-over text to just refer to the PR author. |
This PR makes me really happy. Decades-old crust is finally going away. Thanks all for the hard work! |
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.
The deprecation changes look good but could we split the changes in scipy/_lib/tests/test_warnings.py
off so we don't have to deal with the test failures in this pr
No, see here
That OTOH is possible. |
Thanks for the kind words, though changing a couple function signatures is a far cry from the main work you did in #18488! 💪 |
Yes indeed that was not fun either, but meticulously tracking items over versions is not a trivial feat at all. One comment we are removing in this PR says "Handle deprecation frenzy", and frenzy it is. Thus, much appreciated 😉 |
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.
Thanks @h-vetinari and everyone else
I changed this. |
Follow-up to:
scipy.sparse.linalg.*
#15738sparse.gmres
deprecated kwargrestrt
#16392*tol
deprecations also forgcrotmk/lgmres/minres/tfqmr
#19702