Skip to content
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: sparse.linalg: deprecate positional arguments for gcrotmk, lgmres, minres, tfqmr #18943

Merged
merged 3 commits into from Jul 29, 2023

Conversation

j-bowhay
Copy link
Member

@j-bowhay j-bowhay commented Jul 23, 2023

Reference issue

follow up to #18934, towards #18703

What does this implement/fix?

Agreed for adding gcrotmk, lgmres, minres, tfqmr. The artificial separation was due to Fortran removal efforts, but there is no distinction among these anymore.

Additional information

@j-bowhay j-bowhay added scipy.sparse.linalg deprecated Items related to behavior that has been deprecated labels Jul 23, 2023
@j-bowhay j-bowhay added this to the 1.12.0 milestone Jul 23, 2023
@j-bowhay j-bowhay requested a review from h-vetinari July 23, 2023 04:47
Copy link
Member

@h-vetinari h-vetinari left a comment

Choose a reason for hiding this comment

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

Thanks!

@rgommers
Copy link
Member

This and the previous PR don't look quite right to me. The * should have been either in the place where the deprecated keyword was (tol, IIRC) or otherwise at least in a place where it's an unambiguous win. Which is not the case for x0, which isn't a descriptive keyword (as I think I sketched out somewhere, but I can't find it back).

Forcing users to write gmres(A, B, x0=x0) and forbidding writing gmres(A, B, x0) does not make the code clearer, and it actually breaks a significant amount of end user code when doing so. A quick GitHub code search for "scipy gmres" finds that usage is mixed between positional and keyword usage of x0. E.g., here are two results from the first page of search results that will break:

I'll note that other keywords are clearer and used as keywords in a large majority of cases (e.g., here). However, x0 is not. So I suggest adapting this and previous PRs to leave x0 alone.

@h-vetinari
Copy link
Member

That's a good point, fine by me (which is why I had split these in separate PRs, because the placement of the * is not always 100% self-evident).

@j-bowhay
Copy link
Member Author

Updated as per discussion

Copy link
Member

@h-vetinari h-vetinari left a comment

Choose a reason for hiding this comment

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

Thanks!

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants