[libcamera-devel,06/24] utils: raspberrypi: ctt: Fix pycodestyle E251

Message ID 20200512000322.11753-7-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • utils: raspberrypi: ctt: Comply with pycodestyle
Related show

Commit Message

Laurent Pinchart May 12, 2020, 12:03 a.m. UTC
E251 unexpected spaces around keyword / parameter equals

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 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(-)

Patch

diff --git a/utils/raspberrypi/ctt/ctt.py b/utils/raspberrypi/ctt/ctt.py
index 743ee3bca448..46cf92cd75a2 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 cd99495f6bef..a006f7ffa9c9 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 175986409edd..1ffa4e91b1b7 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 949e3686bc15..55ab4fdbc17d 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 f258bc6d458c..2d021e550f85 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 a15136254a9e..f7a722e0f73e 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)