From patchwork Tue May 12 00:03:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3760 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 64B5560DFE for ; Tue, 12 May 2020 02:03:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="V0r9IGbo"; dkim-atps=neutral Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D1A6133E; Tue, 12 May 2020 02:03:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1589241815; bh=GwNfAeCxzceUjHYmDgv3fDdlQ4dd9EblNIbci8FerZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V0r9IGbo1bZqRoxE2fpNLzDnz/sO7yxNSm1uR16UHN17Yfoi4z4KOLSZkfhIGzEo/ 6drvR+AL3YTDRqY3723xuL6mVNABDN+EgK/PDfZve9IizAewYQBV4fTK7iPOuS5oLn cpITvXMvXhcpbsiIJnVP/TSVoGiiAqv9s4DIkiW8= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Tue, 12 May 2020 03:03:04 +0300 Message-Id: <20200512000322.11753-7-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512000322.11753-1-laurent.pinchart@ideasonboard.com> References: <20200512000322.11753-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 06/24] utils: raspberrypi: ctt: Fix pycodestyle E251 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 00:03:35 -0000 E251 unexpected spaces around keyword / parameter equals Signed-off-by: Laurent Pinchart --- 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 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)