Skip to content
Snippets Groups Projects
Commit cdcfe3d3 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Don't allow appending different data types

parent 5df3f720
No related branches found
No related tags found
No related merge requests found
......@@ -181,6 +181,8 @@ class GenericImageDataAccessor(ABC):
}
def append_channels(self, acc):
if self.dtype != acc.dtype:
raise DataTypeError(f'Cannot append data of type {acc.dtype} to an accessor with type {self.dtype}')
return self._derived_accessor(
np.concatenate(
(self.data, acc.data),
......@@ -570,6 +572,9 @@ class FileNotFoundError(Error):
class DataShapeError(Error):
pass
class DataTypeError(Error):
pass
class FileWriteError(Error):
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment