From 965cae72a79e870f68c6bc28231d701f3518f246 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 2 May 2020 03:32:00 +0300 Subject: utils: raspberrypi: ctt: Fix pycodestyle E251 E251 unexpected spaces around keyword / parameter equals Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: David Plowman --- utils/raspberrypi/ctt/ctt.py | 2 +- utils/raspberrypi/ctt/ctt_alsc.py | 2 +- utils/raspberrypi/ctt/ctt_geq.py | 2 +- utils/raspberrypi/ctt/ctt_macbeth_locator.py | 4 ++-- utils/raspberrypi/ctt/ctt_noise.py | 2 +- utils/raspberrypi/ctt/ctt_ransac.py | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/utils/raspberrypi/ctt/ctt.py b/utils/raspberrypi/ctt/ctt.py index 743ee3bc..46cf92cd 100755 --- a/utils/raspberrypi/ctt/ctt.py +++ b/utils/raspberrypi/ctt/ctt.py @@ -474,7 +474,7 @@ class Camera: run calibration on all images and sort by slope. """ plot = "rpi.noise" in self.plot - noise_out = sorted([noise(self, Img, plot) for Img in self.imgs], key = lambda x: x[0]) + noise_out = sorted([noise(self, Img, plot) for Img in self.imgs], key=lambda x: x[0]) self.log += '\nFinished processing images' """ take the average of the interquartile diff --git a/utils/raspberrypi/ctt/ctt_alsc.py b/utils/raspberrypi/ctt/ctt_alsc.py index cd99495f..a006f7ff 100644 --- a/utils/raspberrypi/ctt/ctt_alsc.py +++ b/utils/raspberrypi/ctt/ctt_alsc.py @@ -131,7 +131,7 @@ def alsc(Cam, Img, do_alsc_colour, plot=False): """ average the green channels into one """ - av_ch_g = np.mean((channels[1:2]), axis = 0) + av_ch_g = np.mean((channels[1:2]), axis=0) if do_alsc_colour: """ obtain 16x12 grid of intensities for each channel and subtract black level diff --git a/utils/raspberrypi/ctt/ctt_geq.py b/utils/raspberrypi/ctt/ctt_geq.py index 17598640..1ffa4e91 100644 --- a/utils/raspberrypi/ctt/ctt_geq.py +++ b/utils/raspberrypi/ctt/ctt_geq.py @@ -27,7 +27,7 @@ def geq_fit(Cam, plot): data is sorted by green difference and top half is selected since higher green difference data define the decision boundary. """ - geqs = np.array(sorted(geqs, key = lambda r: np.abs((r[1]-r[0])/r[0]))) + geqs = np.array(sorted(geqs, key=lambda r: np.abs((r[1]-r[0])/r[0]))) length = len(geqs) g0 = geqs[length//2:, 0] diff --git a/utils/raspberrypi/ctt/ctt_macbeth_locator.py b/utils/raspberrypi/ctt/ctt_macbeth_locator.py index 949e3686..55ab4fdb 100644 --- a/utils/raspberrypi/ctt/ctt_macbeth_locator.py +++ b/utils/raspberrypi/ctt/ctt_macbeth_locator.py @@ -487,8 +487,8 @@ def get_macbeth_chart(img, ref_data): """ clustering = cluster.AgglomerativeClustering( n_clusters=None, - compute_full_tree = True, - distance_threshold = side*2 + compute_full_tree=True, + distance_threshold=side*2 ) mac_mids_list = [x[0] for x in mac_mids] diff --git a/utils/raspberrypi/ctt/ctt_noise.py b/utils/raspberrypi/ctt/ctt_noise.py index f258bc6d..2d021e55 100644 --- a/utils/raspberrypi/ctt/ctt_noise.py +++ b/utils/raspberrypi/ctt/ctt_noise.py @@ -102,7 +102,7 @@ def noise(Cam, Img, plot): plt.plot(x, fit_plot_2, label='fit 0 intercept', color='green', ls='--') plt.plot(0, 0) plt.title('Noise Plot\nImg: {}'.format(Img.str)) - plt.legend(loc = 'upper left') + plt.legend(loc='upper left') plt.xlabel('Sqrt Pixel Value') plt.ylabel('Noise Standard Deviation') plt.grid() diff --git a/utils/raspberrypi/ctt/ctt_ransac.py b/utils/raspberrypi/ctt/ctt_ransac.py index a1513625..f7a722e0 100644 --- a/utils/raspberrypi/ctt/ctt_ransac.py +++ b/utils/raspberrypi/ctt/ctt_ransac.py @@ -11,7 +11,7 @@ scale = 2 """ constructs normalised macbeth chart corners for ransac algorithm """ -def get_square_verts(c_err = 0.05, scale = scale): +def get_square_verts(c_err=0.05, scale=scale): """ define macbeth chart corners """ @@ -57,13 +57,13 @@ def get_square_verts(c_err = 0.05, scale = scale): # print(square_verts) return np.array(square_verts, np.float32), mac_norm -def get_square_centres(c_err = 0.05, scale=scale): +def get_square_centres(c_err=0.05, scale=scale): """ define macbeth square centres """ verts, mac_norm = get_square_verts(c_err, scale=scale) - centres = np.mean(verts, axis = 1) + centres = np.mean(verts, axis=1) # print('centres') # print(centres) return np.array(centres, np.float32) -- cgit v1.2.1