Commit 9f48cd6d authored by Daniel Scheffler's avatar Daniel Scheffler

Fixed issue #22 (GeoArray[slice, slice, np.integer] returns the full array...

Fixed issue #22 (GeoArray[slice, slice, np.integer] returns the full array instead of a single band). Updated version info.
parent 9836f23d
Pipeline #3842 passed with stages
in 1 minute and 58 seconds
......@@ -778,13 +778,13 @@ class GeoArray(object):
if isinstance(givenR, slice):
rS = givenR.start
rE = givenR.stop - 1 if givenR.stop is not None else None
elif isinstance(givenR, int):
elif isinstance(givenR, (int, np.integer)):
rS = givenR
rE = givenR
if isinstance(givenC, slice):
cS = givenC.start
cE = givenC.stop - 1 if givenC.stop is not None else None
elif isinstance(givenC, int):
elif isinstance(givenC, (int, np.integer)):
cS = givenC
cE = givenC
......@@ -794,14 +794,14 @@ class GeoArray(object):
if isinstance(givenB, slice):
bS = givenB.start
bE = givenB.stop - 1 if givenB.stop is not None else None
elif isinstance(givenB, int):
elif isinstance(givenB, (int, np.integer)):
bS = givenB
bE = givenB
elif isinstance(givenB, (tuple, list)):
typesInGivenB = [type(i) for i in givenB]
assert len(list(set(typesInGivenB))) == 1, \
'Mixed data types within the list of bands are not supported.'
if isinstance(givenB[0], int):
if isinstance(givenB[0], (int, np.integer)):
bL = list(givenB)
elif isinstance(givenB[0], str):
bL = [self.bandnames[i] for i in givenB]
......@@ -858,7 +858,7 @@ class GeoArray(object):
if 1 in arr.shape:
outshape = []
for i, sh in enumerate(arr.shape):
if sh == 1 and isinstance(getitem_params[i], (int, float)):
if sh == 1 and isinstance(getitem_params[i], (int, np.integer, float, np.floating)):
pass
else:
outshape.append(sh)
......
__version__ = '0.8.11'
__versionalias__ = '20180214.01'
__version__ = '0.8.12'
__versionalias__ = '20190329.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