Mouse-Imaging-Centre / pyminc

A python interface to the MINC 2 library, allowing use of numpy arrays to access MINC data, and other such similar goodies, developed by Jason Lerch
http://en.wikibooks.org/wiki/MINC/Tutorials
Other
13 stars 8 forks source link

some assertAlmostEqual tests break with newer libs #27

Closed bcdarwin closed 5 years ago

bcdarwin commented 7 years ago

python 3.6.2, numpy 1.13.1

five failures of the following form:

======================================================================
ERROR: testFromFileDataByte (test.generatorTests.TestFromFile)
ensure that byte data is read correct with a precision of 8 decimals on a call to aveage()
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/axiom2/projects/software/arch/linux-xenial-xerus/src/pyminc/test/generatorTests.py", line 187, in testFromFileDataByte
    self.assertAlmostEqual(a, output, 8)
  File "/axiom2/projects/software/arch/linux-xenial-xerus/python/3.6.2/lib/python3.6/unittest/case.py", line 870, in assertAlmostEqual
    if round(abs(second-first), places) == 0:
TypeError: type HyperSlab doesn't define __round__ method

======================================================================
bcdarwin commented 5 years ago

Fixed in 0.52.