[Debichem-devel] New version of python-numpy breaks autopkgtests of python-ase in testing

Stuart Prescott stuart at debian.org
Sun May 13 02:15:57 BST 2018


Hi Sandro

> tbh i dont think this is a good advice: it's likely better to update these
> tests to properly format the output if they depend on it and/or use a
> tolerance in the numeric values returned by numpy (as they may change with
> future optimizations/on different architectures/with different libraries)

Raw numerical output shouldn't be tested and I have to agree with you there. 
That leaves two options, I think: don't use doctests or add lots of formatting 
code to each doctest. I can't see that adding a pile of formatting code to 
every doctest to set the output precision is a win for readability of 
documentation or tests, however. Rewriting numpy's __str__ methods into the 
doctests would not be a win either. Is there a better suggestion you can make 
on that front?

> > # Whitespace changes between numpy 1.13 and 1.14 will cause the doctests
> > # to fail; when doctests are updated to 1.14 format, this can be removed.
> > try:    # CRUFT
> > 
> >      import numpy as np
> >      np.set_printoptions(legacy='1.13')
> > 
> > except TypeError:
> >      pass

Upstreams I've been talking with have been doing exactly this with the 
intention of updating the doctest output some time in the future when they 
feel that requiring numpy > 1.13 is OK (i.e. when they no longer want to 
support various RHEL, Debian and Ubuntu releases with older numpy). 

Changing hundreds of doctests to be a formatted output with a constrained 
number of sig figs is a task that is beyond "quickly fix this RC bug", beyond 
what I'd be prepared to do as a patch without significant discussion with 
upstream and for most upstreams, beyond what they want to do right now too.

cheers
Stuart


-- 
Stuart Prescott    http://www.nanonanonano.net/   stuart at nanonanonano.net
Debian Developer   http://www.debian.org/         stuart at debian.org
GPG fingerprint    90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7



More information about the Debichem-devel mailing list