Skip to content

Conversation

@h-vetinari h-vetinari added scipy.sparse.linalg deprecated Items related to behavior that has been deprecated labels Apr 17, 2024
@h-vetinari h-vetinari mentioned this pull request Apr 17, 2024
32 tasks
@h-vetinari h-vetinari force-pushed the isolve_tol_kwargs branch 2 times, most recently from fae34bd to 19e66ab Compare April 17, 2024 01:40
Comment on lines +146 to +147
def bicgstab(A, b, x0=None, *, rtol=1e-5, atol=0., maxiter=None, M=None,
callback=None):
Copy link
Member Author

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`.
@h-vetinari h-vetinari requested review from rgommers and andyfaff April 17, 2024 05:22
@@ -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")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This innocent-looking line breaks our test_warnings infrastructure; I've fixed it to the best of my (limited) understanding of AST processing, but adding @rgommers / @andyfaff for opinions/help in reviewing scipy/_lib/tests/test_warnings.py.

Comment on lines +44 to +45
match node.args[0]:
case ast.Constant() as c:
Copy link
Member Author

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.

@h-vetinari h-vetinari changed the title DEP: switch sparse methods to kwarg-only; remove tol/restart kwargs DEP: switch sparse methods to kwarg-only; remove tol/restrt kwargs Apr 17, 2024
case _:
raise ValueError("unknown ast node type")
# check if filter is set to ignore
if argtext.split(":")[0] == "ignore":
Copy link
Member Author

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")
Copy link
Member Author

@h-vetinari h-vetinari Apr 17, 2024

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.

@j-bowhay j-bowhay added the needs-work Items that are pending response from the author label Apr 19, 2024
@h-vetinari
Copy link
Member Author

I see the mouse-over text for needs-work Items that are pending response from the author includes the reviewers, but that to me is not clear at all. It seems squarely aimed at the PR author. Can we not distinguish these into "needs work" and "needs review"?

@lucascolley
Copy link
Member

lucascolley commented Apr 20, 2024

I see the mouse-over text for needs-work includes the reviewers, but that to me is not clear at all. It seems squarely aimed at the PR author. Can we not distinguish these into "needs work" and "needs review"?

I've thought about this a bit while triaging first-time contributor PRs. needs-review is really just the absence of needs-work or needs-decision (or needs-champion). The main utility of these labels is for PRs that have been open for a while IMO - there would be no point adding and removing them if the PR is only going to be open a few days.

I wouldn't be opposed to a needs-review, but I think there is a decent argument that it would just add clutter (given that really, if a PR is open, a review would nearly always be a good thing - if it wouldn't, that's what draft PRs are for).

So I propose we change the mouse-over text to just refer to the PR author.

@ilayn
Copy link
Member

ilayn commented Apr 20, 2024

This PR makes me really happy. Decades-old crust is finally going away. Thanks all for the hard work!

Copy link
Member

@j-bowhay j-bowhay left a 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

@h-vetinari
Copy link
Member Author

could we split the changes in scipy/_lib/tests/test_warnings.py off

No, see here

so we don't have to deal with the test failures in this pr

That OTOH is possible.

@h-vetinari
Copy link
Member Author

This PR makes me really happy. Decades-old crust is finally going away. Thanks all for the hard work!

Thanks for the kind words, though changing a couple function signatures is a far cry from the main work you did in #18488! 💪

@ilayn
Copy link
Member

ilayn commented Apr 21, 2024

though changing a couple function signatures is a far cry

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 😉

Copy link
Member

@j-bowhay j-bowhay left a 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

@j-bowhay j-bowhay added this to the 1.14.0 milestone Apr 21, 2024
@j-bowhay j-bowhay merged commit 0b94951 into scipy:main Apr 21, 2024
@h-vetinari h-vetinari deleted the isolve_tol_kwargs branch April 21, 2024 12:18
@lucascolley
Copy link
Member

So I propose we change the mouse-over text to just refer to the PR author.

I changed this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated Items related to behavior that has been deprecated scipy.sparse.linalg scipy.sparse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants