Commit 50b03960 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed linting.


Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent fa94b8e1
Pipeline #22766 passed with stage
in 1 minute and 50 seconds
......@@ -147,9 +147,9 @@ class GeoArray(object):
def _validate_nodataVal(self):
"""Check if a given nodata value is within the valid value range of the data type."""
if (np.issubdtype(self.dtype, np.integer) and
not np.can_cast(self._initParams['nodata'], self.dtype)) or \
not np.can_cast(self._initParams['nodata'], self.dtype)) or \
(np.issubdtype(self.dtype, np.floating) and
not np.can_cast(float(self._initParams['nodata']), self.dtype)):
not np.can_cast(float(self._initParams['nodata']), self.dtype)):
raise ValueError("The given no-data value (%s) is out range for data type %s."
% (self._initParams['nodata'], self.dtype))
......
......@@ -140,11 +140,11 @@ class Test_GeoArray(TestCase):
def test_nodata_out_of_range(self):
"""Test if given nodata value is valid with respect to the array data type."""
# test nodata value in range
gA = GeoArray(np.array([1, 2]).astype(np.uint8), nodata=255)
GeoArray(np.array([1, 2]).astype(np.uint8), nodata=255)
# test nodata value out of range in range
with self.assertRaises(ValueError):
gA = GeoArray(np.array([1, 2]).astype(np.uint8), nodata=256)
GeoArray(np.array([1, 2]).astype(np.uint8), nodata=256)
@parameterized.expand(_get_gA_inMem_notInMem())
def test_calc_mask_nodata(self, _, gA):
......
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