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

Sandro Tosi morph at debian.org
Sat May 12 20:18:50 BST 2018


On Tue, May 8, 2018 at 10:09 PM Stuart Prescott <stuart at debian.org> wrote:

> Hi

> > With a recent upload of python-numpy the autopkgtest of python-ase
> > started to fail in testing [2]. This is currently delaying the migration
> > of python-numpy version 1:1.14.3-2 [3].

> numpy 1.14 has changed its output format for str and repr, changing
whitespace
> and the number of sig figs. This breaks doctests that include direct numpy
> output without formatting the values explicitly.

> It is possible to configure numpy 1.14 to use legacy formatting which
almost
> always fixes the doctest problem. Adding something like the following to
each
> test file, to the pytest conftest.py or to a test runner script is
sufficient:

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)


> # 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

> (including the numpy developers in this so that they can forward this
info to
> any other lost souls)

> 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