![](https://secure.gravatar.com/avatar/a8298bf86074521a12177c2d9ee14941.jpg?s=120&d=mm&r=g)
Paul Virtanen writes:
Date: Thu, 27 Sep 2012 23:57:42 +0300 From: Pauli Virtanen <pav@iki.fi> Subject: Re: [SciPy-User] Flaws in fmin_cobyla (SNIP) Ideally, Ipython consoles et al. would redirect stdout/stderr file handles so that also the output that comes outside from Python land would be shown to the user. However, the correct behavior for Scipy routines would be to print via Python's I/O.
That's OK for "one-shot" optimizations. Not so good for real-world "mutli-shot" optimizations -- unless I'm missing something here. By multi-shot optimizations I mean something like the following: An engine designer has an 18-dimensional design variable, with 24 constraints and 60 args, and wants to run 70 to 100 cases by varying the args. She writes a Python program that reads the args from a file of cases, prepares the inputs to cobyla, turns the cobyla crank and saves its outputs to a file for further analysis. She wants to save all of the Results information from each run to this output file. That's not convenient to do if the Results information is not actually _returned_ by COBYLA. Bob and Paula H "Many of life's failures are people who did not realize how close they were to success when they gave up." (Thomas Edison)
![](https://secure.gravatar.com/avatar/da3a0a1942fbdc5ee9a9b8115ac5dae7.jpg?s=120&d=mm&r=g)
29.09.2012 06:20, The Helmbolds kirjoitti: [clip]
An engine designer has an 18-dimensional design variable, with 24 constraints and 60 args, and wants to run 70 to 100 cases by varying the args. She writes a Python program that reads the args from a file of cases, prepares the inputs to cobyla, turns the cobyla crank and saves its outputs to a file for further analysis. She wants to save all of the Results information from each run to this output file. That's not convenient to do if the Results information is not actually _returned_ by COBYLA.
Good point. This is a good reason why library routines should never print anything. Luckily, it is not more difficult to implement than performing I/O via Python. -- Pauli Virtanen
![](https://secure.gravatar.com/avatar/ed4f792c8377b54b8718a8716b9d8129.jpg?s=120&d=mm&r=g)
The Helmbolds a écrit :
An engine designer has an 18-dimensional design variable, with 24 constraints and 60 args, and wants to run 70 to 100 cases by varying the args. She writes a Python program that reads the args from a file of cases, prepares the inputs to cobyla, turns the cobyla crank and saves its outputs to a file for further analysis. She wants to save all of the Results information from each run to this output file. That's not convenient to do if the Results information is not actually_returned_ by COBYLA.
If by "Results" you mean the Result object that we discussed previously, you would get it using minimize(..., method='cobyla', ...) instead of fmin_cobyla, which is unlikely to change in this respect. -- Denis Laxalde
participants (3)
-
Denis Laxalde
-
Pauli Virtanen
-
The Helmbolds