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

Sandro Tosi morph at debian.org
Sun May 13 05:03:16 BST 2018

On Sat, May 12, 2018 at 9:16 PM Stuart Prescott <stuart at debian.org> wrote:

> Hi Sandro

> > tbh i dont think this is a good advice: it's likely better to update
> > 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
> > future optimizations/on different architectures/with different

> Raw numerical output shouldn't be tested and I have to agree with you
> That leaves two options, I think: don't use doctests or add lots of
> 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
> doctests would not be a win either. Is there a better suggestion you can
> on that front?

> > > # Whitespace changes between numpy 1.13 and 1.14 will cause the
> > > # to fail; when doctests are updated to 1.14 format, this can be
> > > 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

do you have some references here? maybe add them to the wiki page so others
can see there are upstream adopting this solution.

> support various RHEL, Debian and Ubuntu releases with older numpy).

i feel like it's just delaying the fix, as i'm not sure how long numpy
upstream will maintain that legacy formatting, but works for now, sure

> 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",
> 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

> 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

Sandro "morph" Tosi
My website: http://sandrotosi.me/
Me at Debian: http://wiki.debian.org/SandroTosi
G+: https://plus.google.com/u/0/+SandroTosi

More information about the Debichem-devel mailing list