Commit 29260096 authored by Daniel Scheffler's avatar Daniel Scheffler

Bugfix for wrong shape of return value when GeoArray instance is indexed with...

Bugfix for wrong shape of return value when GeoArray instance is indexed with an instance of np.integer. Improved colormap handling within GeoArray.show(). Updated version info.
parent f5241fee
Pipeline #3203 passed with stages
in 1 minute and 42 seconds
......@@ -522,7 +522,7 @@ class GeoArray(object):
meta = alias_property('metadata')
def __getitem__(self, given):
if isinstance(given, (int, float, slice)) and self.ndim == 3:
if isinstance(given, (int, float, slice, np.integer, np.floating)) and self.ndim == 3:
# handle 'given' as index for 3rd (bands) dimension
if self.is_inmem:
return self.arr[:, :, given]
......@@ -1094,7 +1094,7 @@ class GeoArray(object):
res_factor=res_factor, nodataVal=nodataVal)
# set color palette
palette = cmap if cmap else plt.get_cmap('gray')
palette = plt.get_cmap(cmap) if cmap and isinstance(cmap, str) else cmap if cmap else plt.get_cmap('gray')
if nodataVal is not None and np.std(image2plot) != 0: # do not show nodata
image2plot = np.ma.masked_equal(image2plot, nodataVal)
vmin_auto, vmax_auto = \
......
__version__ = '0.8.6'
__versionalias__ = '20180913.01'
__version__ = '0.8.7'
__versionalias__ = '20180917.01'
Markdown is supported
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