Commit 5bf81efd authored by Florent Jaillet's avatar Florent Jaillet
Browse files

Removing FutureWarnings given by numpy 1.4 due to deprecated conversions in np.issubdtype()

parent ea92bd35
......@@ -104,8 +104,8 @@ def assert_sigreshape_pre(f, L=None, dim=None):
f = np.asarray(f)
# ----Check that f type is numeric
if (not np.issubdtype(f.dtype, np.float) and
not np.issubdtype(f.dtype, np.complex) and
if (not np.issubdtype(f.dtype, np.floating) and
not np.issubdtype(f.dtype, np.complexfloating) and
not np.issubdtype(f.dtype, np.integer)):
raise TypeError("f data type should be numeric.")
D = f.ndim
......
......@@ -75,8 +75,8 @@ def comp_sigreshape_pre(f, do_ndim):
"""
if not isinstance(f, np.ndarray):
raise ValueError("f should be a numpy array.")
elif f.size == 0 or (not np.issubdtype(f.dtype, np.float) and
not np.issubdtype(f.dtype, np.complex) and
elif f.size == 0 or (not np.issubdtype(f.dtype, np.floating) and
not np.issubdtype(f.dtype, np.complexfloating) and
not np.issubdtype(f.dtype, np.integer)):
raise ValueError('The input must be non-empty numeric.')
......
......@@ -247,7 +247,7 @@ def comp_window(g, a, M, L=None):
g = fir2long(g, int(np.ceil(g.shape[0] / M) * M))
# Information to be determined post creation.
info['wasreal'] = np.issubdtype(g.dtype, np.float)
info['wasreal'] = np.issubdtype(g.dtype, np.floating)
info['gl'] = g.shape[0]
if L is not None and info['gl'] < L:
info['isfir'] = True
......
......@@ -178,7 +178,7 @@ def dgtreal(f, g, a, M, L=None, pt='freqinv'):
"""
(f, gnum, _, Ls) = gabpars_from_windowsignal(f, g, a, M, L)[0:4]
if not np.issubdtype(gnum.dtype, np.float):
if not np.issubdtype(gnum.dtype, np.floating):
raise ValueError('The window must be real-valued.')
# verify pt
......
......@@ -183,7 +183,7 @@ def gabdual(g, a, M, L=None):
gd = comp_gabdual_long(g, a, M)*scale
# post process result
if np.issubdtype(g.dtype, np.float):
if np.issubdtype(g.dtype, np.floating):
# If g is real then the output is known to be real.
gd = gd.real
......
......@@ -191,7 +191,7 @@ def gabtight(g, a, M, L=None):
gt = comp_gabtight_long(g, a, M) * scale
# post process result
if np.issubdtype(g.dtype, np.float):
if np.issubdtype(g.dtype, np.floating):
# If g is real then the output is known to be real.
gt = gt.real
......
......@@ -204,7 +204,7 @@ def idgtreal(coef, g, a, M, Ls=None, pt='freqinv'):
if L < info['gl']:
raise ValueError('Window is too long.')
if not np.issubdtype(g.dtype, np.float):
if not np.issubdtype(g.dtype, np.floating):
raise ValueError('The window must be real-valued.')
# verify pt
......
......@@ -151,7 +151,7 @@ def normalize(f, norm='2', dim=None):
fnorm[ii] = s0norm(f[:, ii])
f[:, ii] = f[:, ii] / fnorm[ii]
elif norm == 'wav':
if np.issubdtype(f.dtype, np.float):
if np.issubdtype(f.dtype, np.floating):
fnorm[ii] = LA.norm(f[:, ii], np.inf)
f[:, ii] = 0.99 * f[:, ii] / fnorm[ii]
else:
......
......@@ -115,7 +115,7 @@ def _adapt_type(val):
"""
res = val
if isinstance(val, np.ndarray):
if np.issubdtype(val.dtype, np.unicode):
if np.issubdtype(val.dtype, np.unicode_):
# convert the unicode numpy arrays to standard unicode strings
res = val.tolist()
# convert boolean values
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment