On Mon, Jan 26, 2015 at 12:52 PM, Paul Moore <p.f.moore@gmail.com> wrote:
[details snipped]
 
The point I was trying to make earlier (which came across as "nobody
should be coding their own Newton iterations")

well, some people should ;-)

 
is essentially this -
surely iterating a relation until the value you need converges is a
common operation, and libraries exist that do this for you?

sure -- 
 
FWIW, a quick google search came up with scipy.optimize.fixed_point,
which is, AFAICT, the equivalent of your iterate(). (You probably know
better than I do if that's the case).

Sure -- scipy.optimize is full of all sorts of optimizers suited to various problems such as these. However, sometimes you have your particular problem and you just want to get an answer without bringing the while dependency of scipy (or whatever) to bear, and figure out how to use the darn thing. -- and which one to use.

I really did write that function in grad school -- despite having  MATLAB and its optimization package (not to mention the  Fortran minpack) available.

That being said .. if if we want to say the primary use case is testing that's fine with me -- just please not buried in unittest.TestCase somewhere.

-Chris


--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov