Skip to content

[WIN] Stochastic bug: Minc2 data may load as np.longdouble in h5py < 2.10 #665

Closed
@effigies

Description

@effigies

These AppVeyor failures are strange and stochastic. The failures are consistent:

======================================================================
ERROR: autogenerated test from validate_data_deprecated
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python34\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "c:\python34\lib\site-packages\nibabel\tests\test_api_validators.py", line 23, in meth
    validator(self, imaker, params)
  File "c:\python34\lib\site-packages\nibabel\tests\test_image_api.py", line 380, in validate_data_deprecated
    assert_data_similar(img._data, params)
  File "c:\python34\lib\site-packages\nibabel\tests\test_helpers.py", line 80, in assert_data_similar
    real_arr = np.asarray(arr)
  File "c:\python34\lib\site-packages\numpy\core\numeric.py", line 501, in asarray
    return array(a, dtype, copy=False, order=order)
  File "c:\python34\lib\site-packages\nibabel\minc1.py", line 261, in __array__
    return self.minc_file.get_scaled_data()
  File "c:\python34\lib\site-packages\nibabel\minc2.py", line 139, in get_scaled_data
    return self._normalize(raw_data, sliceobj)
  File "c:\python34\lib\site-packages\nibabel\minc1.py", line 189, in _normalize
    dmin, dmax = self._get_valid_range()
  File "c:\python34\lib\site-packages\nibabel\minc2.py", line 98, in _get_valid_range
    info = np.iinfo(ddt.type)
  File "c:\python34\lib\site-packages\numpy\core\getlimits.py", line 516, in __init__
    raise ValueError("Invalid integer data type.")
ValueError: Invalid integer data type.
======================================================================
ERROR: nibabel.tests.test_minc2.TestMinc2File.test_array_proxy_slicing
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python34\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "c:\python34\lib\site-packages\nibabel\tests\test_minc1.py", line 200, in test_array_proxy_slicing
    arr = img.get_data()
  File "c:\python34\lib\site-packages\nibabel\dataobj_images.py", line 202, in get_data
    data = np.asanyarray(self._dataobj)
  File "c:\python34\lib\site-packages\numpy\core\numeric.py", line 553, in asanyarray
    return array(a, dtype, copy=False, order=order, subok=True)
  File "c:\python34\lib\site-packages\nibabel\minc1.py", line 261, in __array__
    return self.minc_file.get_scaled_data()
  File "c:\python34\lib\site-packages\nibabel\minc2.py", line 139, in get_scaled_data
    return self._normalize(raw_data, sliceobj)
  File "c:\python34\lib\site-packages\nibabel\minc1.py", line 189, in _normalize
    dmin, dmax = self._get_valid_range()
  File "c:\python34\lib\site-packages\nibabel\minc2.py", line 98, in _get_valid_range
    info = np.iinfo(ddt.type)
  File "c:\python34\lib\site-packages\numpy\core\getlimits.py", line 516, in __init__
    raise ValueError("Invalid integer data type.")
ValueError: Invalid integer data type.
======================================================================
ERROR: nibabel.tests.test_minc2.TestMinc2File.test_load
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python34\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "c:\python34\lib\site-packages\nibabel\tests\test_minc1.py", line 187, in test_load
    data = img.get_data()
  File "c:\python34\lib\site-packages\nibabel\dataobj_images.py", line 202, in get_data
    data = np.asanyarray(self._dataobj)
  File "c:\python34\lib\site-packages\numpy\core\numeric.py", line 553, in asanyarray
    return array(a, dtype, copy=False, order=order, subok=True)
  File "c:\python34\lib\site-packages\nibabel\minc1.py", line 261, in __array__
    return self.minc_file.get_scaled_data()
  File "c:\python34\lib\site-packages\nibabel\minc2.py", line 139, in get_scaled_data
    return self._normalize(raw_data, sliceobj)
  File "c:\python34\lib\site-packages\nibabel\minc1.py", line 189, in _normalize
    dmin, dmax = self._get_valid_range()
  File "c:\python34\lib\site-packages\nibabel\minc2.py", line 98, in _get_valid_range
    info = np.iinfo(ddt.type)
  File "c:\python34\lib\site-packages\numpy\core\getlimits.py", line 516, in __init__
    raise ValueError("Invalid integer data type.")
ValueError: Invalid integer data type.
======================================================================
ERROR: nibabel.tests.test_minc2.TestMinc2File.test_mincfile_slicing
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python34\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "c:\python34\lib\site-packages\nibabel\tests\test_minc1.py", line 171, in test_mincfile_slicing
    data = mnc.get_scaled_data()
  File "c:\python34\lib\site-packages\nibabel\minc2.py", line 139, in get_scaled_data
    return self._normalize(raw_data, sliceobj)
  File "c:\python34\lib\site-packages\nibabel\minc1.py", line 189, in _normalize
    dmin, dmax = self._get_valid_range()
  File "c:\python34\lib\site-packages\nibabel\minc2.py", line 98, in _get_valid_range
    info = np.iinfo(ddt.type)
  File "c:\python34\lib\site-packages\numpy\core\getlimits.py", line 516, in __init__
    raise ValueError("Invalid integer data type.")
ValueError: Invalid integer data type.
======================================================================
ERROR: nibabel.tests.test_processing.test_spatial_axes_check
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python34\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "c:\python34\lib\site-packages\numpy\testing\_private\decorators.py", line 155, in skipper_func
    return f(*args, **kwargs)
  File "c:\python34\lib\site-packages\nibabel\tests\test_processing.py", line 366, in test_spatial_axes_check
    out = resample_from_to(img, img, mode='nearest')
  File "c:\python34\lib\site-packages\nibabel\processing.py", line 180, in resample_from_to
    cval=cval)
  File "c:\python34\lib\site-packages\scipy\ndimage\interpolation.py", line 416, in affine_transform
    filtered = spline_filter(input, order, output=numpy.float64)
  File "c:\python34\lib\site-packages\scipy\ndimage\interpolation.py", line 113, in spline_filter
    spline_filter1d(input, order, axis, output=output)
  File "c:\python34\lib\site-packages\scipy\ndimage\interpolation.py", line 82, in spline_filter1d
    _nd_image.spline_filter1d(input, order, axis, output)
RuntimeError: array type dtype('float64') not supported
======================================================================
FAIL: autogenerated test from validate_data_interface
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python34\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "c:\python34\lib\site-packages\nibabel\tests\test_api_validators.py", line 23, in meth
    validator(self, imaker, params)
  File "c:\python34\lib\site-packages\nibabel\tests\test_image_api.py", line 208, in validate_data_interface
    self._check_proxy_interface(imaker, meth_name)
  File "c:\python34\lib\site-packages\nibabel\tests\test_image_api.py", line 253, in _check_proxy_interface
    assert_true(data is data_again)
AssertionError: False is not true
======================================================================
FAIL: autogenerated test from validate_dtype
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python34\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "c:\python34\lib\site-packages\nibabel\tests\test_api_validators.py", line 23, in meth
    validator(self, imaker, params)
  File "c:\python34\lib\site-packages\nibabel\tests\test_image_api.py", line 178, in validate_dtype
    assert_equal(img.get_data_dtype().type, params['dtype'])
AssertionError: <class 'numpy.float64'> != <class 'numpy.float64'>
======================================================================
FAIL: nibabel.tests.test_minc2.TestMinc2File.test_mincfile
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python34\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "c:\python34\lib\site-packages\nibabel\tests\test_minc1.py", line 159, in test_mincfile
    assert_equal(mnc.get_data_dtype().type, tp['dtype'])
AssertionError: <class 'numpy.float64'> != <class 'numpy.float64'>

And I've seen them show up in Python 3.4, Python 3.4-x64, Python 3.5 and Python 3.5-x64, but in none of these cases do they consistently fail.

Example builds:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions