Patch

14 views
Skip to first unread message

Robert Schroll

unread,
Jun 25, 2011, 5:12:53 PM6/25/11
to scikits-b...@googlegroups.com
Hi all,

I've been having trouble running bvp_solver functions after a solver
failed. I started digging around in the code and found what I think are
a few bugs with how the successIndicator/INFO parameters are handled.
They were not copied by value back into the Python objects, so all
Solution objects shared the same object here. (Perhaps this relates to
a change in f2py? This (and yerror) are now 1-element arrays; if they
had been simple ints before, this wouldn't have been a problem.) Also,
the BVP INFO value was not properly set to the value passed in from Python.

I've attached a patch that fixes these problems. In a short amount of
testing, they work for me, but I haven't testing them exhaustively. I
also didn't know what format patch would be best; let me know if you'd
like another type.

Thanks,
Robert

bvp_solver.diff

John Salvatier

unread,
Jun 26, 2011, 12:30:32 AM6/26/11
to scikits-b...@googlegroups.com
Hi Robert,

Thanks for this! 

The very easiest thing for me is for you to make a branch of https://github.com/jsalvatier/scikits.bvp_solver and add your changes, then I can pull from it. If you don't know how to do git, I'm sure I can figure out how to make git incorporate a diff file. I would also appreciate any examples you have that break bvp_solver so I can incorporate them into the testing.

I appreciate your hard work,
John

Robert Schroll

unread,
Jun 26, 2011, 1:43:19 AM6/26/11
to scikits-b...@googlegroups.com
On 06/26/2011 12:30 AM, John Salvatier wrote:
> The very easiest thing for me is for you to make a branch of
> https://github.com/jsalvatier/scikits.bvp_solver and add your changes,
> then I can pull from it. If you don't know how to do git, I'm sure I can
> figure out how to make git incorporate a diff file.

Git is good. I've sent a pull request.

> I would also appreciate any examples you have that break bvp_solver
> so I can incorporate them into the testing.

Attached is a simple test that works after this change is applied. The
second call to bvp.solve is designed to fail, but it had been messing up
sol1 in the process. There are two problems: First, sol1 and sol2 share
the same object as ._successIndicator. This is set to indicate failure
after sol2 fails, preventing sol1 from working. Second, the bvp
internals were not having this passed in correctly, so even if
sol1._successIndicator is set correctly, the solver still bails out.

Thanks for providing this tool!

Robert

failedsol.py

John Salvatier

unread,
Jun 26, 2011, 2:00:58 AM6/26/11
to scikits-b...@googlegroups.com
Excellent!
Reply all
Reply to author
Forward
0 new messages