Skip to content

Add backwards compatibility for NormalCG and add deprecation warning#190

Merged
patrick-kidger merged 3 commits intopatrick-kidger:devfrom
jpbrodrick89:jpb/deprectenormalcg
Jan 27, 2026
Merged

Add backwards compatibility for NormalCG and add deprecation warning#190
patrick-kidger merged 3 commits intopatrick-kidger:devfrom
jpbrodrick89:jpb/deprectenormalcg

Conversation

@jpbrodrick89
Copy link
Contributor

Thought I'd try get this in in light of the upcoming release, I find that lx.NormalCG(rtol=..., atol=...) no longer works as our helper function only accepts positional arguments.

Super looking forward to the new release, it will greatly clean up a ProjectionOperator I've been using that uses a linear solver internally that I had to special case to tell square solves to solve normal equations instead. Thanks for all the great work everyone's put in, especially on LSMR! Do we have a special way of testing whether a solver can handle rectangular matrices?

Will also try to brush of my other PR's today if there's still time for that.

jpbrodrick89 and others added 3 commits January 17, 2026 22:16
- Added **kwargs support to NormalCG function signature
- Added DeprecationWarning directing users to use lx.Normal(lx.CG(...)) instead
- Added docstring with deprecation notice
- Imported warnings module
- Use "in favour of" phrasing (consistent with Diffrax)
- Add backticks around code examples
- Specify "in some future version of Lineax"
- Keep DeprecationWarning category (more semantically correct)
- Update both warning message and docstring
@patrick-kidger
Copy link
Owner

LGTM! Thank you :)

I'm inclined to get the current release out (as I'd like to do a Diffrax release on the back of it), but I'd be happy to do another fast-follow release with your other PRs.

@patrick-kidger patrick-kidger merged commit 29412fc into patrick-kidger:dev Jan 27, 2026
1 check failed
patrick-kidger pushed a commit that referenced this pull request Jan 27, 2026
…190)

* Deprecate NormalCG helper function

- Added **kwargs support to NormalCG function signature
- Added DeprecationWarning directing users to use lx.Normal(lx.CG(...)) instead
- Added docstring with deprecation notice
- Imported warnings module

* Align deprecation warning with Diffrax patterns

- Use "in favour of" phrasing (consistent with Diffrax)
- Add backticks around code examples
- Specify "in some future version of Lineax"
- Keep DeprecationWarning category (more semantically correct)
- Update both warning message and docstring

* fix precommit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants