<div dir="ltr">On Sat, Jan 24, 2015 at 12:21 PM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Sat, Jan 24, 2015 at 11:59 AM, Chris Barker <span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span> wrote:<span></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><div>I'd much rather require people to have to think about what makes sense for their use case than get trapped by a default that's totally inappropriate.<span></span></div></div></div></div></blockquote><div><br></div></span><div>And by the time you have thought through your use case you're probably better off just writing abs(x-y) <= eps for some eps that you decide from your use case.<br></div></div></div></div></blockquote><div><br></div><div>Exactly why I never thought a function to simply do an absolute closeness test wasn't worth it.<br><br></div><div>This is for the case where you want a relative test, but also want something sane for a comparison to zero. If there aren't any zeros in your data, you don't need to think about it. If there are, it will fail, and then you will have to think about it.<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>The number of messages written to debate this one simple formula make me think it's not so simple after all. </div></div></div></div></blockquote><div><br></div><div>well, we shouldn't underestimate the capacity for bike-shedding.<br></div><div><br></div><div>Next I plan to go through full set of messages since I posted the PEP, and tease out the real disagreements/decision points -- I guess I'll see how that pans out.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>So perhaps this is, once again, something that's better off as a recipe?<br></div></div></div></div></blockquote><div><br></div><div>I hope not, but if consensus can't be reached, perhaps so.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Alternatively, maybe a useful approach to resolving this debate could be to look for places in actual code where people have solved this for their own use case (as in, written by someone else to solve a real problem, not made up as an example). </div></div></div></div></blockquote><div><br></div><div>I've got a pile of uses of numpy's all_close (mostly tests) and it would be easy to search for those in other places. Not sure how to find other uses in other people's code though.<br><br></div>And, of course, Steven put something similar in the statistics tests.<br><br></div><div class="gmail_quote">So maybe the idea that this is primarily a new testing utility is the way to go.<br></div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><div>Then if you see a particular pattern occur repeatedly, you might be able to use that evidence to suggest the right helper function that does the whole thing in one call, and by looking at variations you might get a good insight in the needed parameters and defaults.<br></div></div><span class=""></span></div></div></blockquote></div><br></div><div class="gmail_extra">I have no idea how to find those, but if anyone has suggestions for how to look, or examples in their own code, that would be great.<br><br></div><div class="gmail_extra">-Chris<br><br></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>