From 8abef62d46e1b31aebc3ebbfcf5227ef9c62e9fc Mon Sep 17 00:00:00 2001 From: lodenthal <lodenthal@uni-bielefeld.de> Date: Fri, 15 Dec 2017 10:16:35 +0300 Subject: [PATCH] stuff from todo list --- navipy/database/__init__.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/navipy/database/__init__.py b/navipy/database/__init__.py index b69c6a6..63b107c 100644 --- a/navipy/database/__init__.py +++ b/navipy/database/__init__.py @@ -149,8 +149,9 @@ It creates three sql table on initialisation. self.db_cursor = self.db.cursor() for tablename, _ in self.tablecolumns.items(): if not self.table_exist(tablename): - raise Exception('{} does not contain a table named {}'.format( - filename, tablename)) + raise Exception('{} does not contain\ + a table named {}'.format( + filename, tablename)) elif self.create(): # Create database self.db = sqlite3.connect( @@ -365,8 +366,9 @@ database if not len(image.shape) == 3: raise Exception('image should be 3D array') if not image.shape[2] == len(self.channels): - raise Exception('image does not have the required number of channels {}'.format( - len(self.channels))) + raise Exception('image does not have the\ + required number of channels {}'.format( + len(self.channels))) if not isinstance(cmaxminrange, pd.Series): raise TypeError('cmaxminrange should be a pandas Series') denormed_im = np.zeros(image.shape, dtype=np.float) @@ -382,7 +384,8 @@ database cimage += cmin denormed_im[:, :, chan_i] = cimage if not np.max(cimage) == cmax: - raise Exception('denormalisation failed {}!={}'.format(np.max(cimage), cmax)) + raise Exception('denormalisation failed\ + {}!={}'.format(np.max(cimage), cmax)) return denormed_im -- GitLab