Skip to content

Commit

Permalink
Merge pull request #587 from carterbox/warnings
Browse files Browse the repository at this point in the history
MAI: Fix deprecation warnings from scipy
  • Loading branch information
carterbox committed Jun 30, 2022
2 parents 7151b22 + 8f7545b commit a1e402d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -43,7 +43,7 @@ install_requires =
numexpr==2.*
# numpy 1.22.4 breaks distribute_jobs
# https://github.com/numpy/numpy/issues/21612
numpy>=1.12,!=1.22.4
numpy~=1.12,!=1.22.4
pywavelets==1.*
scikit-image~=0.17
scipy==1.*
Expand Down
10 changes: 5 additions & 5 deletions source/tomopy/misc/corr.py
Expand Up @@ -53,7 +53,7 @@
unicode_literals)

import numpy as np
from scipy.ndimage import filters
import scipy.ndimage
import tomopy.util.mproc as mproc
import tomopy.util.dtype as dtype
import tomopy.util.extern as extern
Expand Down Expand Up @@ -154,7 +154,7 @@ def gaussian_filter(arr, sigma=3, order=0, axis=0, ncore=None):
slc = [slice(None)] * arr.ndim
for i in range(arr.shape[axis]):
slc[axis] = i
e.submit(filters.gaussian_filter,
e.submit(scipy.ndimage.gaussian_filter,
arr[tuple(slc)],
sigma,
order=order,
Expand Down Expand Up @@ -192,7 +192,7 @@ def median_filter(arr, size=3, axis=0, ncore=None):
slc = [slice(None)] * arr.ndim
for i in range(arr.shape[axis]):
slc[axis] = i
e.submit(filters.median_filter,
e.submit(scipy.ndimage.median_filter,
arr[tuple(slc)],
size=(size, size),
output=out[tuple(slc)])
Expand Down Expand Up @@ -470,7 +470,7 @@ def remove_outlier(arr, dif, size=3, axis=0, ncore=None, out=None):
slc = [slice(None)] * arr.ndim
for i in range(ncore):
slc[axis] = chnk_slices[i]
e.submit(filters.median_filter,
e.submit(scipy.ndimage.median_filter,
arr[tuple(slc)],
size=filt_size,
output=tmp[tuple(slc)])
Expand Down Expand Up @@ -529,7 +529,7 @@ def remove_outlier1d(arr, dif, size=3, axis=0, ncore=None, out=None):
slc = [slice(None)] * arr.ndim
for i in range(ncore):
slc[lar_axis] = chnk_slices[i]
e.submit(filters.median_filter,
e.submit(scipy.ndimage.median_filter,
arr[slc],
size=filt_size,
output=tmp[slc],
Expand Down
4 changes: 2 additions & 2 deletions source/tomopy/recon/rotation.py
Expand Up @@ -254,8 +254,8 @@ def find_center_vo(tomo, ind=None, smin=-50, smax=50, srad=6, step=0.25,
# Denoising
# There's a critical reason to use different window sizes
# between coarse and fine search.
_tomo_cs = ndimage.filters.gaussian_filter(_tomo, (3, 1), mode='reflect')
_tomo_fs = ndimage.filters.gaussian_filter(_tomo, (2, 2), mode='reflect')
_tomo_cs = ndimage.gaussian_filter(_tomo, (3, 1), mode='reflect')
_tomo_fs = ndimage.gaussian_filter(_tomo, (2, 2), mode='reflect')

# Coarse and fine searches for finding the rotation center.
if _tomo.shape[0] * _tomo.shape[1] > 4e6: # If data is large (>2kx2k)
Expand Down

0 comments on commit a1e402d

Please sign in to comment.