[Numpy-discussion] `allclose` vs `assert_allclose`

josef.pktd at gmail.com josef.pktd at gmail.com
Fri Jul 18 07:41:57 EDT 2014


On Thu, Jul 17, 2014 at 11:37 AM, Nathaniel Smith <njs at pobox.com> wrote:

> On Wed, Jul 16, 2014 at 7:47 PM, Ralf Gommers <ralf.gommers at gmail.com>
> wrote:
> >
> > On Wed, Jul 16, 2014 at 6:37 AM, Tony Yu <tsyu80 at gmail.com> wrote:
> >> It seems like the defaults for  `allclose` and `assert_allclose` should
> >> match, and an absolute tolerance of 0 is probably not ideal. I guess
> this is
> >> a pretty big behavioral change, but the current default for
> >> `assert_allclose` doesn't seem ideal.
> >
> > I agree, current behavior quite annoying. It would make sense to change
> the
> > atol default to 1e-8, but technically it's a backwards compatibility
> break.
> > Would probably have a very minor impact though. Changing the default for
> > rtol in one of the functions may be much more painful though, I don't
> think
> > that should be done.
>
> Currently we have:
>
> allclose: rtol=1e-5, atol=1e-8
> assert_allclose: rtol=1e-7, atol=0
>
> Why would it be painful to change assert_allclose to match allclose?
> It would weaken some tests, but no code would break.
>

We might break our code, if suddenly our test suite doesn't do what it is
supposed to do.

(rough guess: 40% of the statsmodels code are unit tests.)

Josef


>
> -n
>
> --
> Nathaniel J. Smith
> Postdoctoral researcher - Informatics - University of Edinburgh
> http://vorpus.org
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20140718/c862aa2d/attachment.html>


More information about the NumPy-Discussion mailing list