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

bug: ensure array shape consistency in leastsquares solvers #624

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

mrava87
Copy link
Collaborator

@mrava87 mrava87 commented Nov 25, 2024

PyLops solvers output the solution as a nd-shaped array if the initial model is fed as nd-arrays or if the initial model is not fed (x0=0) and the operator has forceflat=False. As a side effect, if x0 is NOT passed as a kwarg (but just as the third arg of the solver) and the operator forceflat=False, the output is reshaped even if x0 is a flattened array. I fix this inconsistency making x0 a kwarg when basic solvers are called within a leastsquares solver.

PyLops solvers output the solution as a nd-shaped array
if the initial model is fed as nd-arrays or if the initial
model is not fed (x0=0) and the operator has forceflat=False. As a side
effect, if x0 is NOT passed as a kwarg (but just as the third arg of
the solver) and the operator forceflat=False, the output is reshaped
even if x0 is a flattened array. I fix this inconsistency making x0
a kwarg when basic solvers are called within a leastsquares solver.
@mrava87 mrava87 marked this pull request as ready for review November 25, 2024 08:55
@mrava87 mrava87 merged commit 8d9def3 into PyLops:dev Nov 25, 2024
13 checks passed
@mrava87 mrava87 deleted the bug-lssolvers branch November 25, 2024 09:56
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.

1 participant