Skip to content
Snippets Groups Projects
Commit fc9bc7b2 authored by Luise Odenthal's avatar Luise Odenthal
Browse files

changes some little things in database init like typeerror to valueerror and so on

parent 2509175a
No related branches found
No related tags found
No related merge requests found
......@@ -376,7 +376,7 @@ database
if rowid is np.nan:
raise ValueError('rowid must not be nan')
if (posorient is None) and (rowid is None):
Exception('posorient and rowid can not be both None')
raise Exception('posorient and rowid can not be both None')
if posorient is not None:
rowid = self.get_posid(posorient)
# Read images
......@@ -466,6 +466,8 @@ database
return toreturn
def denormalise_image(self, image, cmaxminrange):
if not isinstance(image,np.ndarray):
raise TypeError('image must be np.array')
if len(image.shape) != 3:
raise Exception('image should be 3D array')
if image.shape[2] != len(self.channels):
......@@ -473,7 +475,7 @@ database
number of channels {}'.format(
len(self.channels)))
if not isinstance(cmaxminrange, pd.Series):
raise Exception('cmaxminrange should be a pandas Series')
raise TypeError('cmaxminrange should be a pandas Series')
if cmaxminrange.empty:
raise Exception('cmaxminrange must not be empty')
for chan_n in self.channels:
......
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