> > > > Making the behavior of assert_allclose depending on whether desired is > > exactly zero or 1e-20 looks too difficult to remember, and which desired > I > > use would depend on what I get out of R or Stata. > > I thought your whole point here was that 1e-20 and zero are > qualitatively different values that you would not want to accidentally > confuse? Surely R and Stata aren't returning exact zeros for small > non-zero values like probability tails? > > I was thinking of the case when we only see "pvalue < 1e-16" or something like this, and we replace this by assert close to zero. which would translate to `assert_allclose(pvalue, 0, atol=1e-16)` with maybe an additional rtol=1e-11 if we have an array of pvalues where some are "large" (>0.5).
It's not a very frequent case, mainly when we don't have access to the underlying float numbers and only have the print representation. Josef
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
