Commit 7896b92e authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Bugfix for rejecting GeoArray subclasses by GeoArray

io.raster.GeoArray:
- __init__(): bugfix for wrong if-condition
- dump(): added docstring
parent 76fe39f0
......@@ -69,11 +69,10 @@ class GeoArray(object):
# FIXME implement compatibility to GDAL VRTs
if type(path_or_array) not in [str, np.ndarray, GeoArray] and not \
not issubclass(getattr(path_or_array,'__class__'), GeoArray):
raise ValueError("%s parameter 'arg' takes only string, np.ndarray or GeoArray types. Got %s."
%(self.__class__.__name__,type(path_or_array)))
if not (isinstance(path_or_array, (str, np.ndarray, GeoArray)) or
issubclass(getattr(path_or_array,'__class__'), GeoArray)):
raise ValueError("%s parameter 'arg' takes only string, np.ndarray or GeoArray(and subclass) instances."
"Got %s." %(self.__class__.__name__,type(path_or_array)))
if path_or_array is None:
raise ValueError("The %s parameter 'path_or_array' must not be None!" %self.__class__.__name__)
......@@ -750,7 +749,7 @@ class GeoArray(object):
def dump(self, out_path):
# type: (str)
"""Sertialize the whole object instance to disk using dill."""
"""Serialize the whole object instance to disk using dill."""
import dill
with open(out_path,'w') as outF:
dill.dump(self,outF)
......
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