diff --git a/spectral/__init__.py b/spectral/__init__.py index d750d5c..7633db1 100644 --- a/spectral/__init__.py +++ b/spectral/__init__.py @@ -4,7 +4,7 @@ from __future__ import absolute_import, division, print_function, unicode_literals -__version__ = '0.22.2' +__version__ = '0.22.3' import sys if sys.byteorder == 'little': diff --git a/spectral/config.py b/spectral/config.py index 6f89c8a..4841c2a 100644 --- a/spectral/config.py +++ b/spectral/config.py @@ -157,5 +157,4 @@ class SpySettings: [100, 0, 100], [200, 0, 200], [0, 100, 100], - [0, 200, 200]], np.int) - + [0, 200, 200]], np.int8) diff --git a/spectral/graphics/colorscale.py b/spectral/graphics/colorscale.py index d287b47..5f1e0f5 100644 --- a/spectral/graphics/colorscale.py +++ b/spectral/graphics/colorscale.py @@ -52,13 +52,13 @@ def __init__(self, levels, colors, num_tics=0): if type(levels) in (list, tuple): levels = [float(x) for x in levels] elif isinstance(levels, np.ndarray): - levels = levels.astype(np.float) + levels = levels.astype(float) self.span = levels[-1] - levels[0] self.max = levels[-1] self.min = levels[0] self.tics = np.linspace(self.min, self.max, num_tics) - self.colorTics = np.zeros((len(self.tics), 3), np.int) + self.colorTics = np.zeros((len(self.tics), 3), int) self.size = len(self.tics) self.bgColor = np.array([0, 0, 0]) @@ -71,7 +71,7 @@ def __init__(self, levels, colors, num_tics=0): dcolor = colors[j] - colors[j - 1] dlevel = levels[j] - levels[j - 1] self.colorTics[i] = (colors[j - 1] + (self.tics[i] - levels[j - 1]) - / dlevel * dcolor).astype(np.int) + / dlevel * dcolor).astype(int) def __call__(self, val): '''Returns the scale color associated with the given value.''' diff --git a/spectral/graphics/graphics.py b/spectral/graphics/graphics.py index f8d3286..4c82d8b 100644 --- a/spectral/graphics/graphics.py +++ b/spectral/graphics/graphics.py @@ -566,7 +566,7 @@ def get_rgb_meta(source, bands=None, **kwargs): # Pick the first, middle, and last bands n = source.shape[-1] bands = [0, n // 2, n - 1] - rgb = source.read_bands(bands).astype(np.float) + rgb = source.read_bands(bands).astype(float) meta['bands'] = bands else: # It should be a numpy array @@ -587,7 +587,7 @@ def get_rgb_meta(source, bands=None, **kwargs): # first, middle, & last bands. bands = [0, s[2] / 2, s[2] - 1] - rgb = np.take(source, bands, 2).astype(np.float) + rgb = np.take(source, bands, 2).astype(float) if rgb.ndim == 2: rgb = rgb[:, :, np.newaxis] meta['bands'] = bands @@ -614,14 +614,14 @@ def get_rgb_meta(source, bands=None, **kwargs): scale.set_range(min(rgb.ravel()), max(rgb.ravel())) rgb3 = np.zeros((s[0], s[1], 3), int) rgb3 = np.apply_along_axis(scale, 2, rgb) - rgb = rgb3.astype(np.float) / 255. + rgb = rgb3.astype(float) / 255. return (_fill_mask(rgb, mask, bg), meta) else: # Only one band of data to display but still need to determine how # to scale the data values meta['mode'] = 'monochrome' monochrome = True - rgb = np.repeat(rgb, 3, 2).astype(np.float) + rgb = np.repeat(rgb, 3, 2).astype(float) # Perform any requested color enhancements. diff --git a/spectral/graphics/ndwindow.py b/spectral/graphics/ndwindow.py index 9d279ef..f9c7a7b 100644 --- a/spectral/graphics/ndwindow.py +++ b/spectral/graphics/ndwindow.py @@ -348,7 +348,7 @@ def __init__(self, data, parent, id, *args, **kwargs): self.data = data self.classes = kwargs.get('classes', - np.zeros(data.shape[:-1], np.int)) + np.zeros(data.shape[:-1], int)) self.features = kwargs.get('features', list(range(6))) self.labels = kwargs.get('labels', list(range(data.shape[-1]))) self.max_menu_class = int(np.max(self.classes.ravel() + 1)) diff --git a/spectral/io/spyfile.py b/spectral/io/spyfile.py index 21a08af..0619ae3 100644 --- a/spectral/io/spyfile.py +++ b/spectral/io/spyfile.py @@ -550,8 +550,8 @@ def tile_image(im, nrows, ncols): contains nrows lists, each of which contains ncols SubImage objects. ''' - x = (np.array(list(range(nrows + 1))) * float(im.nrows) / nrows).astype(np.int) - y = (np.array(list(range(ncols + 1))) * float(im.ncols) / ncols).astype(np.int) + x = (np.array(list(range(nrows + 1))) * float(im.nrows) / nrows).astype(int) + y = (np.array(list(range(ncols + 1))) * float(im.ncols) / ncols).astype(int) x[-1] = im.nrows y[-1] = im.ncols