[SciPy-User] cobyla
Sloan Lindsey
sloan.lindsey at gmail.com
Mon Mar 25 07:55:30 EDT 2013
How does one parse the doc string? I'm interested in having my script
know when MAXFUN is reached. I see it coming out as a print line ( I
have to use 0.7.2 because of an older centOS install), but I'd really
like my script to know that it has happened so I can tag that solution
as suspect. Is there any cute way to redirect that output into
something I can parse?
-Sloan
On Mon, Oct 1, 2012 at 9:58 PM, Ralf Gommers <ralf.gommers at gmail.com> wrote:
>
>
> On Sun, Sep 30, 2012 at 11:09 PM, The Helmbolds <helmrp at yahoo.com> wrote:
>>
>> On my system (Windows 7, Python 2.7.x and IDLE, latest SciPy), I observe
>> the following behavior with fmin_cobyla and minimize's COBYLA method.
>>
>> Case 1: When run either in the IDLE interactive shell or within an
>> enclosing Python program:
>> 1.1. The fmin_cobyla function never returns the Results dictionary,
>> and never displays it to Python's stdout. This is true regardless of the
>> function call's disp setting.
>
>
> Correct. The fmin_cobyla docstring clearly says what it returns. Result
> objects are only returned by the new interfaces in the 0.11.0 release
> (minimize, minimize_scalar, root).
>
>> 1.2. The 'minimize' function always returns the Results dictionary but
>> never displays it to Python's stdout. Again, this is true regardless of the
>> function call's disp setting.
>
>
> `disp` doesn't print the Results objects. For me it works as advertized (in
> IPython), it prints something like:
>
> Normal return from subroutine COBYLA
>
> NFVALS = 37 F = 8.000000E-01 MAXCV = 0.000000E+00
> X = 1.400113E+00 1.700056E+00
>
> Ralf
>
>>
>> Case 2: When run interactively in Window's Command Prompt box:
>> 2.1 The fmin_cobyla function never returns the Result dictionary,
>> regardless of the function call's disp setting. Setting disp to True or
>> False either displays the Results dictionary in the command box or not
>> (respectively). I don't think the Results dictionary gets to the command box
>> via stdout.
>> 2.2 The 'minimize' function always returns the Result dictionary,
>> regardless of the function call's disp setting. Setting disp to True or
>> False either displays the Results dictionary in the command box or not
>> (respectively). I don't think the Results dictionary gets to the command box
>> via stdout.
>>
>> My thanks to all who helped clarify this situation.
>>
>> Bob H
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
More information about the SciPy-User
mailing list