Skip to content

Commit

Permalink
Support SciPy 1.0.0+ too (#37)
Browse files Browse the repository at this point in the history
* Relax SciPy version constraint

Allow users to install with SciPy 1.0.0+.

* Use SciPy 1.0.0 on CIs

Start testing with SciPy 1.0.0 on CIs.

* Skip some tests that fail due to a SciPy 1.0.0 bug

Appears that SciPy 1.0.0+ has a bug that causes it to incorrectly
compute some Fourier filters when the data has double precision. So add
a check to skip these cases. We still test the filters for other
precision. So this doesn't block us from testing them as well.

* Switch back to SciPy 0.19.1 on CIs

As coverage drops when testing with SciPy 1.0.0+ due to some tests that
need to be skipped due to a SciPy bug, switch back to testing with SciPy
0.19.1. After all there appear to be no other significant differences
between the two versions of SciPy.
  • Loading branch information
jakirkham committed Aug 31, 2018
1 parent 2f8a291 commit 126d0a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def run_tests(self):
requirements = [
"dask >=0.13.0",
"numpy >=1.11.3",
"scipy >=0.18.1,<1.0.0",
"scipy >=0.18.1",
"pims >=0.3.3",
]

Expand Down
13 changes: 13 additions & 0 deletions tests/test_dask_image/test_ndfourier/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
from __future__ import absolute_import

import numbers
from distutils.version import LooseVersion

import pytest

import numpy as np
import scipy as sp
import scipy.ndimage.fourier as sp_ndf

import dask.array as da
Expand Down Expand Up @@ -94,6 +96,17 @@ def test_fourier_filter_identity(funcname, s):
]
)
def test_fourier_filter_type(funcname, upcast_type, dtype):
if (LooseVersion(sp.__version__) >= "1.0.0" and (
dtype is np.int64 or
dtype is np.float64
) and (
funcname is "fourier_gaussian" or
funcname is "fourier_uniform"
)):
pytest.skip(
"SciPy 1.0.0+ doesn't handle double precision values correctly."
)

dtype = np.dtype(dtype).type

s = 1
Expand Down

0 comments on commit 126d0a6

Please sign in to comment.