We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Similar to what was discussed here. Built with this and this, however, numpy is patched with a fix
python -c "from scipy import test; test('full')"
=================================== FAILURES =================================== _______________________ TestIDCTIVFloat.test_definition ________________________ self = <scipy.fftpack.tests.test_real_transforms.TestIDCTIVFloat object at 0x7fd0ec3c36a0> def test_definition(self): for i in FFTWDATA_SIZES: xr, yr, dt = fftw_dct_ref(self.type, i, self.rdt) x = idct(yr, type=self.type) if self.type == 1: x /= 2 * (i-1) else: x /= 2 * i assert_equal(x.dtype, dt) # XXX: we divide by np.max(y) because the tests fail otherwise. We # should really use something like assert_array_approx_equal. The # difference is due to fftw using a better algorithm w.r.t error # propagation compared to the ones from fftpack. assert_array_almost_equal(x / np.max(x), xr / np.max(x), decimal=self.dec, > err_msg="Size %d failed" % i) E AssertionError: E Arrays are not almost equal to 5 decimals E Size 1024 failed E Mismatch: 10.1% E Max absolute difference: 1.6570091e-05 E Max relative difference: inf E x: array([-8.94958e-08, 9.77623e-04, 1.95480e-03, ..., 9.98045e-01, E 9.99055e-01, 1.00000e+00], dtype=float32) E y: array([0.00000e+00, 9.77533e-04, 1.95507e-03, ..., 9.98061e-01, E 9.99039e-01, 1.00002e+00], dtype=float32) dt = dtype('float32') i = 1024 self = <scipy.fftpack.tests.test_real_transforms.TestIDCTIVFloat object at 0x7fd0ec3c36a0> x = array([-9.15527344e-05, 1.00009155e+00, 1.99972534e+00, ..., 1.02098315e+03, 1.02201660e+03, 1.02298315e+03], dtype=float32) xr = array([0.000e+00, 1.000e+00, 2.000e+00, ..., 1.021e+03, 1.022e+03, 1.023e+03], dtype=float32) yr = array([ 484493.03 , -539250.6 , 232890.28 , ..., -1023.5095 , 1023.50183, -1023.5007 ], dtype=float32) /usr/lib/python3.7/site-packages/scipy/fftpack/tests/test_real_transforms.py:376: AssertionError ______________________________ TestODR.test_multi ______________________________ self = <scipy.odr.tests.test_odr.TestODR object at 0x7fd0ec8f24e0> def test_multi(self): multi_mod = Model( self.multi_fcn, meta=dict(name='Sample Multi-Response Model', ref='ODRPACK UG, pg. 56'), ) multi_x = np.array([30.0, 50.0, 70.0, 100.0, 150.0, 200.0, 300.0, 500.0, 700.0, 1000.0, 1500.0, 2000.0, 3000.0, 5000.0, 7000.0, 10000.0, 15000.0, 20000.0, 30000.0, 50000.0, 70000.0, 100000.0, 150000.0]) multi_y = np.array([ [4.22, 4.167, 4.132, 4.038, 4.019, 3.956, 3.884, 3.784, 3.713, 3.633, 3.54, 3.433, 3.358, 3.258, 3.193, 3.128, 3.059, 2.984, 2.934, 2.876, 2.838, 2.798, 2.759], [0.136, 0.167, 0.188, 0.212, 0.236, 0.257, 0.276, 0.297, 0.309, 0.311, 0.314, 0.311, 0.305, 0.289, 0.277, 0.255, 0.24, 0.218, 0.202, 0.182, 0.168, 0.153, 0.139], ]) n = len(multi_x) multi_we = np.zeros((2, 2, n), dtype=float) multi_ifixx = np.ones(n, dtype=int) multi_delta = np.zeros(n, dtype=float) multi_we[0,0,:] = 559.6 multi_we[1,0,:] = multi_we[0,1,:] = -1634.0 multi_we[1,1,:] = 8397.0 for i in range(n): if multi_x[i] < 100.0: multi_ifixx[i] = 0 elif multi_x[i] <= 150.0: pass # defaults are fine elif multi_x[i] <= 1000.0: multi_delta[i] = 25.0 elif multi_x[i] <= 10000.0: multi_delta[i] = 560.0 elif multi_x[i] <= 100000.0: multi_delta[i] = 9500.0 else: multi_delta[i] = 144000.0 if multi_x[i] == 100.0 or multi_x[i] == 150.0: multi_we[:,:,i] = 0.0 multi_dat = Data(multi_x, multi_y, wd=1e-4/np.power(multi_x, 2), we=multi_we) multi_odr = ODR(multi_dat, multi_mod, beta0=[4.,2.,7.,.4,.5], delta0=multi_delta, ifixx=multi_ifixx) multi_odr.set_job(deriv=1, del_init=1) out = multi_odr.run() assert_array_almost_equal( out.beta, np.array([4.3799880305938963, 2.4333057577497703, 8.0028845899503978, > 0.5101147161764654, 0.5173902330489161]), ) E AssertionError: E Arrays are not almost equal to 6 decimals E E Mismatch: 100% E Max absolute difference: 1.00288459 E Max relative difference: 0.21586265 E x: array([4. , 2. , 7. , 0.4, 0.5]) E y: array([4.379988, 2.433306, 8.002885, 0.510115, 0.51739 ]) i = 22 multi_dat = <scipy.odr.odrpack.Data object at 0x7fd0ec8f2eb8> multi_delta = array([0.00e+00, 0.00e+00, 0.00e+00, 0.00e+00, 0.00e+00, 2.50e+01, 2.50e+01, 2.50e+01, 2.50e+01, 2.50e+01, 5.60... 5.60e+02, 5.60e+02, 5.60e+02, 5.60e+02, 9.50e+03, 9.50e+03, 9.50e+03, 9.50e+03, 9.50e+03, 9.50e+03, 1.44e+05]) multi_ifixx = array([0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) multi_mod = <scipy.odr.odrpack.Model object at 0x7fd0ec8f20b8> multi_odr = <scipy.odr.odrpack.ODR object at 0x7fd0ec8f21d0> multi_we = array([[[ 559.6, 559.6, 559.6, 0. , 0. , 559.6, 559.6, 559.6, 559.6, 559.6, 559.6, ... 8397. , 8397. , 8397. , 8397. , 8397. , 8397. , 8397. , 8397. , 8397. , 8397. , 8397. ]]]) multi_x = array([3.0e+01, 5.0e+01, 7.0e+01, 1.0e+02, 1.5e+02, 2.0e+02, 3.0e+02, 5.0e+02, 7.0e+02, 1.0e+03, 1.5e+03, 2.0e+03, 3.0e+03, 5.0e+03, 7.0e+03, 1.0e+04, 1.5e+04, 2.0e+04, 3.0e+04, 5.0e+04, 7.0e+04, 1.0e+05, 1.5e+05]) multi_y = array([[4.22 , 4.167, 4.132, 4.038, 4.019, 3.956, 3.884, 3.784, 3.713, 3.633, 3.54 , 3.433, 3.358, 3.258, 3.19...09, 0.311, 0.314, 0.311, 0.305, 0.289, 0.277, 0.255, 0.24 , 0.218, 0.202, 0.182, 0.168, 0.153, 0.139]]) n = 23 out = <scipy.odr.odrpack.Output object at 0x7fd0ec7fb0f0> self = <scipy.odr.tests.test_odr.TestODR object at 0x7fd0ec8f24e0> /usr/lib/python3.7/site-packages/scipy/odr/tests/test_odr.py:213: AssertionError _____________________________ TestODR.test_pearson _____________________________ self = <scipy.odr.tests.test_odr.TestODR object at 0x7fd0ec7fb2e8> def test_pearson(self): p_x = np.array([0.,.9,1.8,2.6,3.3,4.4,5.2,6.1,6.5,7.4]) p_y = np.array([5.9,5.4,4.4,4.6,3.5,3.7,2.8,2.8,2.4,1.5]) p_sx = np.array([.03,.03,.04,.035,.07,.11,.13,.22,.74,1.]) p_sy = np.array([1.,.74,.5,.35,.22,.22,.12,.12,.1,.04]) p_dat = RealData(p_x, p_y, sx=p_sx, sy=p_sy) # Reverse the data to test invariance of results pr_dat = RealData(p_y, p_x, sx=p_sy, sy=p_sx) p_mod = Model(self.pearson_fcn, meta=dict(name='Uni-linear Fit')) p_odr = ODR(p_dat, p_mod, beta0=[1.,1.]) pr_odr = ODR(pr_dat, p_mod, beta0=[1.,1.]) out = p_odr.run() assert_array_almost_equal( out.beta, > np.array([5.4767400299231674, -0.4796082367610305]), ) E AssertionError: E Arrays are not almost equal to 6 decimals E E Mismatch: 100% E Max absolute difference: 4.47674003 E Max relative difference: 3.08503508 E x: array([1., 1.]) E y: array([ 5.47674 , -0.479608]) out = <scipy.odr.odrpack.Output object at 0x7fd0ec353278> p_dat = <scipy.odr.odrpack.RealData object at 0x7fd0ec7fb3c8> p_mod = <scipy.odr.odrpack.Model object at 0x7fd0ec7fb438> p_odr = <scipy.odr.odrpack.ODR object at 0x7fd0ec7fb400> p_sx = array([0.03 , 0.03 , 0.04 , 0.035, 0.07 , 0.11 , 0.13 , 0.22 , 0.74 , 1. ]) p_sy = array([1. , 0.74, 0.5 , 0.35, 0.22, 0.22, 0.12, 0.12, 0.1 , 0.04]) p_x = array([0. , 0.9, 1.8, 2.6, 3.3, 4.4, 5.2, 6.1, 6.5, 7.4]) p_y = array([5.9, 5.4, 4.4, 4.6, 3.5, 3.7, 2.8, 2.8, 2.4, 1.5]) pr_dat = <scipy.odr.odrpack.RealData object at 0x7fd0ec7fb208> pr_odr = <scipy.odr.odrpack.ODR object at 0x7fd0ec7fb470> self = <scipy.odr.tests.test_odr.TestODR object at 0x7fd0ec7fb2e8> /usr/lib/python3.7/site-packages/scipy/odr/tests/test_odr.py:259: AssertionError _____________________________ TestODR.test_lorentz _____________________________ self = <scipy.odr.tests.test_odr.TestODR object at 0x7fd0ec353320> def test_lorentz(self): l_sy = np.array([.29]*18) l_sx = np.array([.000972971,.000948268,.000707632,.000706679, .000706074, .000703918,.000698955,.000456856, .000455207,.000662717,.000654619,.000652694, .000000859202,.00106589,.00106378,.00125483, .00140818,.00241839]) l_dat = RealData( [3.9094, 3.85945, 3.84976, 3.84716, 3.84551, 3.83964, 3.82608, 3.78847, 3.78163, 3.72558, 3.70274, 3.6973, 3.67373, 3.65982, 3.6562, 3.62498, 3.55525, 3.41886], [652, 910.5, 984, 1000, 1007.5, 1053, 1160.5, 1409.5, 1430, 1122, 957.5, 920, 777.5, 709.5, 698, 578.5, 418.5, 275.5], sx=l_sx, sy=l_sy, ) l_mod = Model(self.lorentz, meta=dict(name='Lorentz Peak')) l_odr = ODR(l_dat, l_mod, beta0=(1000., .1, 3.8)) out = l_odr.run() assert_array_almost_equal( out.beta, np.array([1.4306780846149925e+03, 1.3390509034538309e-01, > 3.7798193600109009e+00]), ) E AssertionError: E Arrays are not almost equal to 6 decimals E E Mismatch: 100% E Max absolute difference: 430.67808461 E Max relative difference: 0.30103074 E x: array([1.0e+03, 1.0e-01, 3.8e+00]) E y: array([1.430678e+03, 1.339051e-01, 3.779819e+00]) l_dat = <scipy.odr.odrpack.RealData object at 0x7fd0ec353390> l_mod = <scipy.odr.odrpack.Model object at 0x7fd0ec353438> l_odr = <scipy.odr.odrpack.ODR object at 0x7fd0ec3534a8> l_sx = array([9.72971e-04, 9.48268e-04, 7.07632e-04, 7.06679e-04, 7.06074e-04, 7.03918e-04, 6.98955e-04, 4.56856e-04, ... 6.54619e-04, 6.52694e-04, 8.59202e-07, 1.06589e-03, 1.06378e-03, 1.25483e-03, 1.40818e-03, 2.41839e-03]) l_sy = array([0.29, 0.29, 0.29, 0.29, 0.29, 0.29, 0.29, 0.29, 0.29, 0.29, 0.29, 0.29, 0.29, 0.29, 0.29, 0.29, 0.29, 0.29]) out = <scipy.odr.odrpack.Output object at 0x7fd0ec357278> self = <scipy.odr.tests.test_odr.TestODR object at 0x7fd0ec353320> /usr/lib/python3.7/site-packages/scipy/odr/tests/test_odr.py:316: AssertionError =============================== warnings summary ===============================
import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info) 1.2.1 1.16.1 sys.version_info(major=3, minor=7, micro=2, releaselevel='final', serial=0)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Similar to what was discussed here.
Built with this and this, however, numpy is patched with a fix
Reproducing code example:
Error message:
Scipy/Numpy/Python version information:
The text was updated successfully, but these errors were encountered: