Skip to content

astropy.units test failures with Numpy 1.18 from conda on Windows #9871

@astrofrog

Description

@astrofrog

Maintainer note: Revert temporary pinning in #9878 when this is resolved unless #9726 gets to it first.

I'm seeing test failures on Windows with Numpy 1.18 - and these are also happening on Travis for the Windows build. To reproduce:

conda create -n test-conda-numpy python=3.7
conda activate test-conda-numpy
conda install numpy
pip install -e .[test]
pytest astropy\units

The error log is:

====================================================== FAILURES =======================================================
__________________________________________________ TestFFT.test_fft ___________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C00148>

    def test_fft(self):
>       self.check(np.fft.fft)

astropy\units\tests\test_quantity_non_ufuncs.py:1845:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C00148>
func = <function fft at 0x00000224CE5CB168>, args = (), kwargs = {}
o = array([[ 120. +0.j        ,   -8.+40.21871594j,   -8.+19.3137085j ,
          -8.+11.9728461j ,   -8. +8.j        ,   ...,   -8. -5.3454291j ,
          -8. -8.j        ,   -8.-11.9728461j ,   -8.-19.3137085j ,
          -8.-40.21871594j]])
expected = <Quantity [[ 120. +0.j        ,   -8.+40.21871594j,   -8.+19.3137085j ,
              -8.+11.9728461j ,   -8. +8.j    ....3454291j ,
              -8. -8.j        ,   -8.-11.9728461j ,   -8.-19.3137085j ,
              -8.-40.21871594j]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[ 120....0.21871594j]]) == <Quantity [[ ...21871594j]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[ 120....0.21871594j]]) == <Quantity [[ ...21871594j]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
__________________________________________________ TestFFT.test_ifft __________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2BEC888>

    def test_ifft(self):
>       self.check(np.fft.ifft)

astropy\units\tests\test_quantity_non_ufuncs.py:1848:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2BEC888>
func = <function ifft at 0x00000224CE5CB288>, args = (), kwargs = {}
o = array([[  7.5-0.j        ,  -0.5-2.51366975j,  -0.5-1.20710678j,
         -0.5-0.74830288j,  -0.5-0.5j       ,  -0.5-0...0678j,  -0.5+0.33408932j,
         -0.5+0.5j       ,  -0.5+0.74830288j,  -0.5+1.20710678j,
         -0.5+2.51366975j]])
expected = <Quantity [[  7.5-0.j        ,  -0.5-2.51366975j,  -0.5-1.20710678j,
             -0.5-0.74830288j,  -0.5-0.5j       ,....5+0.33408932j,
             -0.5+0.5j       ,  -0.5+0.74830288j,  -0.5+1.20710678j,
             -0.5+2.51366975j]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[  7.5...2.51366975j]]) == <Quantity [[ ...51366975j]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[  7.5...2.51366975j]]) == <Quantity [[ ...51366975j]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
__________________________________________________ TestFFT.test_rfft __________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C0AE48>

    def test_rfft(self):
>       self.check(np.fft.rfft)

astropy\units\tests\test_quantity_non_ufuncs.py:1851:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C0AE48>
func = <function rfft at 0x00000224CE5CB318>, args = (), kwargs = {}
o = array([[ 120. +0.j        ,   -8.+40.21871594j,   -8.+19.3137085j ,
          -8.+11.9728461j ,   -8. +8.j        ,   ...728461j ,   -8. +8.j        ,   -8. +5.3454291j ,
          -8. +3.3137085j ,   -8. +1.59129894j,   -8. +0.j        ]])
expected = <Quantity [[ 120. +0.j        ,   -8.+40.21871594j,   -8.+19.3137085j ,
              -8.+11.9728461j ,   -8. +8.j    ...j ,   -8. +8.j        ,   -8. +5.3454291j ,
              -8. +3.3137085j ,   -8. +1.59129894j,   -8. +0.j        ]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[ 120....0.j        ]]) == <Quantity [[ ...j        ]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[ 120....0.j        ]]) == <Quantity [[ ...j        ]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
_________________________________________________ TestFFT.test_irfft __________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C3BDC8>

    def test_irfft(self):
>       self.check(np.fft.irfft)

astropy\units\tests\test_quantity_non_ufuncs.py:1854:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C3BDC8>
func = <function irfft at 0x00000224CE5CB3A8>, args = (), kwargs = {}
o = array([[ 7.50000000e+00, -3.05077103e+00,  8.88178420e-17,
        -3.49071198e-01,  7.77156117e-17, -1.33333333e-01,
...         5.26245714e-15, -1.33333333e-01,  4.66293670e-16,
        -3.49071198e-01, -4.73695157e-16, -3.05077103e+00]])
expected = <Quantity [[ 7.50000000e+00, -3.05077103e+00,  8.88178420e-17,
            -3.49071198e-01,  7.77156117e-17, -1.333333...   5.26245714e-15, -1.33333333e-01,  4.66293670e-16,
            -3.49071198e-01, -4.73695157e-16, -3.05077103e+00]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[ 7.50...5077103e+00]]) == <Quantity [[ ...77103e+00]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[ 7.50...5077103e+00]]) == <Quantity [[ ...77103e+00]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
__________________________________________________ TestFFT.test_fft2 __________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C70588>

    def test_fft2(self):
>       self.check(np.fft.fft2)

astropy\units\tests\test_quantity_non_ufuncs.py:1857:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C70588>
func = <function fft2 at 0x00000224CE5CB798>, args = (), kwargs = {}
o = array([[ 8128.   +0.j        ,   -64. +321.7497275j ,
          -64. +154.50966799j,   -64.  +95.78276881j,
          ...        ,
            0.   -0.j        ,     0.   -0.j        ,
            0.   -0.j        ,     0.   -0.j        ]])
expected = <Quantity [[ 8128.   +0.j        ,   -64. +321.7497275j ,
              -64. +154.50966799j,   -64.  +95.78276881j,
  ...                0.   -0.j        ,     0.   -0.j        ,
                0.   -0.j        ,     0.   -0.j        ]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[ 8128...0.j        ]]) == <Quantity [[ ...j        ]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[ 8128...0.j        ]]) == <Quantity [[ ...j        ]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
_________________________________________________ TestFFT.test_ifft2 __________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2B8ED88>

    def test_ifft2(self):
>       self.check(np.fft.ifft2)

astropy\units\tests\test_quantity_non_ufuncs.py:1860:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2B8ED88>
func = <function ifft2 at 0x00000224CE5CB828>, args = (), kwargs = {}
o = array([[63.5 -0.j        , -0.5 -2.51366975j, -0.5 -1.20710678j,
        -0.5 -0.74830288j, -0.5 -0.5j       , -0.5 -0...     ,  0.  +0.j        ,
         0.  +0.j        ,  0.  +0.j        ,  0.  +0.j        ,
         0.  +0.j        ]])
expected = <Quantity [[63.5 -0.j        , -0.5 -2.51366975j, -0.5 -1.20710678j,
            -0.5 -0.74830288j, -0.5 -0.5j       ,...  +0.j        ,
             0.  +0.j        ,  0.  +0.j        ,  0.  +0.j        ,
             0.  +0.j        ]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[63.5 ...0.j        ]]) == <Quantity [[6...j        ]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[63.5 ...0.j        ]]) == <Quantity [[6...j        ]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
_________________________________________________ TestFFT.test_rfft2 __________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C74708>

    def test_rfft2(self):
>       self.check(np.fft.rfft2)

astropy\units\tests\test_quantity_non_ufuncs.py:1863:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C74708>
func = <function rfft2 at 0x00000224CE5CB948>, args = (), kwargs = {}
o = array([[ 8128.   +0.j        ,   -64. +321.7497275j ,
          -64. +154.50966799j,   -64.  +95.78276881j,
          ...        ,     0.   +0.j        ,
            0.   +0.j        ,     0.   +0.j        ,
            0.   +0.j        ]])
expected = <Quantity [[ 8128.   +0.j        ,   -64. +321.7497275j ,
              -64. +154.50966799j,   -64.  +95.78276881j,
  ...    0.   +0.j        ,
                0.   +0.j        ,     0.   +0.j        ,
                0.   +0.j        ]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[ 8128...0.j        ]]) == <Quantity [[ ...j        ]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[ 8128...0.j        ]]) == <Quantity [[ ...j        ]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
_________________________________________________ TestFFT.test_irfft2 _________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C4BA88>

    def test_irfft2(self):
>       self.check(np.fft.irfft2)

astropy\units\tests\test_quantity_non_ufuncs.py:1866:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C4BA88>
func = <function irfft2 at 0x00000224CE5CBA68>, args = (), kwargs = {}
o = array([[ 6.35000000e+01, -3.05077103e+00,  8.30105637e-17,
        -3.49071198e-01,  1.22730749e-15, -1.33333333e-01,
...        -5.92118946e-16,  2.23015496e+00,  1.18423789e-16,
         3.96276551e+00, -1.18423789e-16,  1.22505108e+01]])
expected = <Quantity [[ 6.35000000e+01, -3.05077103e+00,  8.30105637e-17,
            -3.49071198e-01,  1.22730749e-15, -1.333333...  -5.92118946e-16,  2.23015496e+00,  1.18423789e-16,
             3.96276551e+00, -1.18423789e-16,  1.22505108e+01]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[ 6.35...2505108e+01]]) == <Quantity [[ ...05108e+01]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[ 6.35...2505108e+01]]) == <Quantity [[ ...05108e+01]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
__________________________________________________ TestFFT.test_fftn __________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C75388>

    def test_fftn(self):
>       self.check(np.fft.fftn)

astropy\units\tests\test_quantity_non_ufuncs.py:1869:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C75388>
func = <function fftn at 0x00000224CE5CB678>, args = (), kwargs = {}
o = array([[ 8128.   +0.j        ,   -64. +321.7497275j ,
          -64. +154.50966799j,   -64.  +95.78276881j,
          ...        ,
            0.   -0.j        ,     0.   -0.j        ,
            0.   -0.j        ,     0.   -0.j        ]])
expected = <Quantity [[ 8128.   +0.j        ,   -64. +321.7497275j ,
              -64. +154.50966799j,   -64.  +95.78276881j,
  ...                0.   -0.j        ,     0.   -0.j        ,
                0.   -0.j        ,     0.   -0.j        ]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[ 8128...0.j        ]]) == <Quantity [[ ...j        ]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[ 8128...0.j        ]]) == <Quantity [[ ...j        ]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
_________________________________________________ TestFFT.test_ifftn __________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2CF5DC8>

    def test_ifftn(self):
>       self.check(np.fft.ifftn)

astropy\units\tests\test_quantity_non_ufuncs.py:1872:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2CF5DC8>
func = <function ifftn at 0x00000224CE5CB708>, args = (), kwargs = {}
o = array([[63.5 -0.j        , -0.5 -2.51366975j, -0.5 -1.20710678j,
        -0.5 -0.74830288j, -0.5 -0.5j       , -0.5 -0...     ,  0.  +0.j        ,
         0.  +0.j        ,  0.  +0.j        ,  0.  +0.j        ,
         0.  +0.j        ]])
expected = <Quantity [[63.5 -0.j        , -0.5 -2.51366975j, -0.5 -1.20710678j,
            -0.5 -0.74830288j, -0.5 -0.5j       ,...  +0.j        ,
             0.  +0.j        ,  0.  +0.j        ,  0.  +0.j        ,
             0.  +0.j        ]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[63.5 ...0.j        ]]) == <Quantity [[6...j        ]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[63.5 ...0.j        ]]) == <Quantity [[6...j        ]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
_________________________________________________ TestFFT.test_rfftn __________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C4B488>

    def test_rfftn(self):
>       self.check(np.fft.rfftn)

astropy\units\tests\test_quantity_non_ufuncs.py:1875:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C4B488>
func = <function rfftn at 0x00000224CE5CB8B8>, args = (), kwargs = {}
o = array([[ 8128.   +0.j        ,   -64. +321.7497275j ,
          -64. +154.50966799j,   -64.  +95.78276881j,
          ...        ,     0.   +0.j        ,
            0.   +0.j        ,     0.   +0.j        ,
            0.   +0.j        ]])
expected = <Quantity [[ 8128.   +0.j        ,   -64. +321.7497275j ,
              -64. +154.50966799j,   -64.  +95.78276881j,
  ...    0.   +0.j        ,
                0.   +0.j        ,     0.   +0.j        ,
                0.   +0.j        ]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[ 8128...0.j        ]]) == <Quantity [[ ...j        ]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[ 8128...0.j        ]]) == <Quantity [[ ...j        ]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
_________________________________________________ TestFFT.test_irfftn _________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C1E648>

    def test_irfftn(self):
>       self.check(np.fft.irfftn)

astropy\units\tests\test_quantity_non_ufuncs.py:1878:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C1E648>
func = <function irfftn at 0x00000224CE5CB9D8>, args = (), kwargs = {}
o = array([[ 6.35000000e+01, -3.05077103e+00,  8.30105637e-17,
        -3.49071198e-01,  1.22730749e-15, -1.33333333e-01,
...        -5.92118946e-16,  2.23015496e+00,  1.18423789e-16,
         3.96276551e+00, -1.18423789e-16,  1.22505108e+01]])
expected = <Quantity [[ 6.35000000e+01, -3.05077103e+00,  8.30105637e-17,
            -3.49071198e-01,  1.22730749e-15, -1.333333...  -5.92118946e-16,  2.23015496e+00,  1.18423789e-16,
             3.96276551e+00, -1.18423789e-16,  1.22505108e+01]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[ 6.35...2505108e+01]]) == <Quantity [[ ...05108e+01]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[ 6.35...2505108e+01]]) == <Quantity [[ ...05108e+01]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
__________________________________________________ TestFFT.test_hfft __________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2B2B608>

    def test_hfft(self):
>       self.check(np.fft.hfft)

astropy\units\tests\test_quantity_non_ufuncs.py:1881:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2B2B608>
func = <function hfft at 0x00000224CE5CB438>, args = (), kwargs = {}
o = array([[ 2.25000000e+02, -9.15231310e+01,  2.66453526e-15,
        -1.04721360e+01,  2.33146835e-15, -4.00000000e+00,
...         1.57873714e-13, -4.00000000e+00,  1.39888101e-14,
        -1.04721360e+01, -1.42108547e-14, -9.15231310e+01]])
expected = <Quantity [[ 2.25000000e+02, -9.15231310e+01,  2.66453526e-15,
            -1.04721360e+01,  2.33146835e-15, -4.000000...   1.57873714e-13, -4.00000000e+00,  1.39888101e-14,
            -1.04721360e+01, -1.42108547e-14, -9.15231310e+01]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[ 2.25...5231310e+01]]) == <Quantity [[ ...31310e+01]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[ 2.25...5231310e+01]]) == <Quantity [[ ...31310e+01]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
_________________________________________________ TestFFT.test_ihfft __________________________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C1E788>

    def test_ihfft(self):
>       self.check(np.fft.ihfft)

astropy\units\tests\test_quantity_non_ufuncs.py:1884:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFFT object at 0x00000224D2C1E788>
func = <function ihfft at 0x00000224CE5CB4C8>, args = (), kwargs = {}
o = array([[  7.5+0.j        ,  -0.5-2.51366975j,  -0.5-1.20710678j,
         -0.5-0.74830288j,  -0.5-0.5j       ,  -0.5-0...5-0.74830288j,  -0.5-0.5j       ,  -0.5-0.33408932j,
         -0.5-0.20710678j,  -0.5-0.09945618j,  -0.5-0.j        ]])
expected = <Quantity [[  7.5+0.j        ,  -0.5-2.51366975j,  -0.5-1.20710678j,
             -0.5-0.74830288j,  -0.5-0.5j       ,...830288j,  -0.5-0.5j       ,  -0.5-0.33408932j,
             -0.5-0.20710678j,  -0.5-0.09945618j,  -0.5-0.j        ]] s>
@py_assert1 = <function all at 0x00000224CE3A0948>, @py_assert5 = None, @py_assert3 = None, @py_assert4 = False
@py_assert8 = False
@py_format6 = 'array([[  7.5...0.j        ]]) == <Quantity [[ ...j        ]] s>\n~Use -v to get the full diff'

    def check(self, func, *args, **kwargs):
        o = func(self.q, *args, **kwargs)
        expected = func(self.q.value, *args, **kwargs) * self.q.unit
        assert o.shape == expected.shape
>       assert np.all(o == expected)
E       assert False
E        +  where False = <function all at 0x00000224CE3A0948>(array([[  7.5...0.j        ]]) == <Quantity [[ ...j        ]] s>
E        +    where <function all at 0x00000224CE3A0948> = np.all
E           Use -v to get the full diff)

astropy\units\tests\test_quantity_non_ufuncs.py:68: AssertionError
__________________________________ TestFunctionHelpersCompleteness.test_all_included __________________________________

self = <astropy.units.tests.test_quantity_non_ufuncs.TestFunctionHelpersCompleteness object at 0x00000224D2D440C8>

    @pytest.mark.xfail(NO_ARRAY_FUNCTION,
                       reason="no __array_function__ wrapping in numpy<1.17")
    def test_all_included(self):
        included_in_helpers = (SUBCLASS_SAFE_FUNCTIONS |
                               UNSUPPORTED_FUNCTIONS |
                               set(FUNCTION_HELPERS.keys()) |
                               set(DISPATCHED_FUNCTIONS.keys()))
>       assert all_wrapped == included_in_helpers
E       AssertionError: assert {<function ze...E396048>, ...} == {<function mo...E39A048>, ...}
E         Extra items in the right set:
E         <function ifft2 at 0x00000224CE5CB828>
E         <function hfft at 0x00000224CE5CB438>
E         <function irfft2 at 0x00000224CE5CBA68>
E         <function fftn at 0x00000224CE5CB678>
E         <function ifft at 0x00000224CE5CB288>
E         <function rfftn at 0x00000224CE5CB8B8>...
E
E         ...Full output truncated (10 lines hidden), use '-vv' to show

astropy\units\tests\test_quantity_non_ufuncs.py:2184: AssertionError
=============================== 15 failed, 2417 passed, 3 skipped, 1 xfailed in 15.01s ================================

Interestingly if I remove the conda package for Numpy and install with pip:

conda remove numpy
pip install numpy six

then the failures go away! (six is for one of the pytest plugins)

cc @mhvk

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions