{"id":3756,"url":"https://patchwork.libcamera.org/api/1.1/patches/3756/?format=json","web_url":"https://patchwork.libcamera.org/patch/3756/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200512000322.11753-3-laurent.pinchart@ideasonboard.com>","date":"2020-05-12T00:03:00","name":"[libcamera-devel,02/24] utils: raspberrypi: ctt: Fix pycodestyle E201 and E202","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"f6fbcad30a41466c5f12ffe2ff1efc2f884bbf92","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/3756/mbox/","series":[{"id":897,"url":"https://patchwork.libcamera.org/api/1.1/series/897/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=897","date":"2020-05-12T00:02:58","name":"utils: raspberrypi: ctt: Comply with pycodestyle","version":1,"mbox":"https://patchwork.libcamera.org/series/897/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/3756/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/3756/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9461E60DFD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 May 2020 02:03:33 +0200 (CEST)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1D92011F6;\n\tTue, 12 May 2020 02:03:33 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"nYNe/NJJ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1589241813;\n\tbh=z2brZA6ZwnjrQxMxTsbGpltZNyFexrlRm8iWN6SiJxE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=nYNe/NJJI2clXPPGJyqKC8Hsi1ZoqKquBwyPzUuaRadT2L2DblWNee/1UHuNGahyb\n\tfj5iEJiUtfWocZf5Qjju4LTXX1K7j+UUBMN2xAE+Ukjhfit7hF1fHVGO7rqlJr94S4\n\tZfoHYtp2nCMOyUZuK5uX26sKiJw9XAuXFk/Baml4=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 12 May 2020 03:03:00 +0300","Message-Id":"<20200512000322.11753-3-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","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 02/24] utils: raspberrypi: ctt: Fix\n\tpycodestyle E201 and E202","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 12 May 2020 00:03:34 -0000"},"content":"E201 whitespace after '('\nE201 whitespace after '{'\nE201 whitespace after '['\nE202 whitespace before '}'\nE202 whitespace before ']'\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n utils/raspberrypi/ctt/ctt.py        | 30 ++++++++++++++---------------\n utils/raspberrypi/ctt/ctt_ccm.py    | 12 ++++++------\n utils/raspberrypi/ctt/ctt_geq.py    |  2 +-\n utils/raspberrypi/ctt/ctt_ransac.py |  2 +-\n 4 files changed, 23 insertions(+), 23 deletions(-)","diff":"diff --git a/utils/raspberrypi/ctt/ctt.py b/utils/raspberrypi/ctt/ctt.py\nindex 3674d3107966..ba2dbd713e55 100755\n--- a/utils/raspberrypi/ctt/ctt.py\n+++ b/utils/raspberrypi/ctt/ctt.py\n@@ -58,7 +58,7 @@ def get_col_lux(string):\n         Still returns colour if that has been found.\n         \"\"\"\n         return col, None\n-    return int( col ), int( lux )\n+    return int(col), int(lux)\n \n \"\"\"\n Camera object that is the backbone of the tuning tool.\n@@ -96,18 +96,18 @@ class Camera:\n             },\n             \"rpi.awb\": {\n                 \"priors\" : [\n-                    {\"lux\": 0, \"prior\": [ 2000, 1.0, 3000, 0.0, 13000, 0.0]},\n-                    {\"lux\": 800, \"prior\": [ 2000, 0.0, 6000, 2.0, 13000, 2.0]},\n-                    {\"lux\": 1500, \"prior\": [ 2000, 0.0, 4000, 1.0, 6000, 6.0, 6500, 7.0, 7000, 1.0, 13000, 1.0]}\n+                    {\"lux\": 0, \"prior\": [2000, 1.0, 3000, 0.0, 13000, 0.0]},\n+                    {\"lux\": 800, \"prior\": [2000, 0.0, 6000, 2.0, 13000, 2.0]},\n+                    {\"lux\": 1500, \"prior\": [2000, 0.0, 4000, 1.0, 6000, 6.0, 6500, 7.0, 7000, 1.0, 13000, 1.0]}\n                 ],\n                 \"modes\" : {\n-                    \"auto\" : { \"lo\" : 2500, \"hi\" : 8000 },\n-                    \"incandescent\" : { \"lo\" : 2500, \"hi\" : 3000 },\n-                    \"tungsten\" : { \"lo\" : 3000, \"hi\" : 3500 },\n-                    \"fluorescent\" : { \"lo\" : 4000, \"hi\" : 4700 },\n-                    \"indoor\" : { \"lo\" : 3000, \"hi\" : 5000 },\n-                    \"daylight\" : { \"lo\" : 5500, \"hi\" : 6500 },\n-                    \"cloudy\" : { \"lo\" : 7000, \"hi\" : 8600 }\n+                    \"auto\" : {\"lo\" : 2500, \"hi\" : 8000},\n+                    \"incandescent\" : {\"lo\" : 2500, \"hi\" : 3000},\n+                    \"tungsten\" : {\"lo\" : 3000, \"hi\" : 3500},\n+                    \"fluorescent\" : {\"lo\" : 4000, \"hi\" : 4700},\n+                    \"indoor\" : {\"lo\" : 3000, \"hi\" : 5000},\n+                    \"daylight\" : {\"lo\" : 5500, \"hi\" : 6500},\n+                    \"cloudy\" : {\"lo\" : 7000, \"hi\" : 8600}\n                 },\n                 \"bayes\" : 1\n             },\n@@ -129,8 +129,8 @@ class Camera:\n                         \"gain\"    : [1.0, 2.0,   4.0,   6.0,   6.0]\n                     },\n                     \"sport\": {\n-                        \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n-                        \"gain\":    [ 1.0, 2.0,  4.0,   6.0,   6.0    ]\n+                        \"shutter\": [100, 5000, 10000, 20000, 120000],\n+                        \"gain\":    [1.0, 2.0,  4.0,   6.0,   6.0   ]\n                     }\n                 },\n                 \"constraint_modes\" : {\n@@ -138,8 +138,8 @@ class Camera:\n                         {\"bound\" : \"LOWER\", \"q_lo\" : 0.98, \"q_hi\" : 1.0, \"y_target\" : [0, 0.5, 1000, 0.5]}\n                     ],\n                     \"highlight\": [\n-                        { \"bound\": \"LOWER\", \"q_lo\": 0.98, \"q_hi\": 1.0, \"y_target\": [ 0, 0.5, 1000, 0.5 ] },\n-                        { \"bound\": \"UPPER\", \"q_lo\": 0.98, \"q_hi\": 1.0, \"y_target\": [ 0, 0.8, 1000, 0.8 ] }\n+                        {\"bound\": \"LOWER\", \"q_lo\": 0.98, \"q_hi\": 1.0, \"y_target\": [0, 0.5, 1000, 0.5]},\n+                        {\"bound\": \"UPPER\", \"q_lo\": 0.98, \"q_hi\": 1.0, \"y_target\": [0, 0.8, 1000, 0.8]}\n                     ]\n                 },\n                 \"y_target\" : [0, 0.16, 1000, 0.165, 10000, 0.17]\ndiff --git a/utils/raspberrypi/ctt/ctt_ccm.py b/utils/raspberrypi/ctt/ctt_ccm.py\nindex 1771fc43327d..44fb81885368 100644\n--- a/utils/raspberrypi/ctt/ctt_ccm.py\n+++ b/utils/raspberrypi/ctt/ctt_ccm.py\n@@ -168,12 +168,12 @@ def do_ccm(r, g, b, m_srgb):\n     rb_gbs = (rb*gb)\n     gb_2s = (gb*gb)\n \n-    r_rbs = ( rb * (m_srgb[..., 0] - b) )\n-    r_gbs = ( gb * (m_srgb[..., 0] - b) )\n-    g_rbs = ( rb * (m_srgb[..., 1] - b) )\n-    g_gbs = ( gb * (m_srgb[..., 1] - b) )\n-    b_rbs = ( rb * (m_srgb[..., 2] - b) )\n-    b_gbs = ( gb * (m_srgb[..., 2] - b) )\n+    r_rbs = rb * (m_srgb[..., 0] - b)\n+    r_gbs = gb * (m_srgb[..., 0] - b)\n+    g_rbs = rb * (m_srgb[..., 1] - b)\n+    g_gbs = gb * (m_srgb[..., 1] - b)\n+    b_rbs = rb * (m_srgb[..., 2] - b)\n+    b_gbs = gb * (m_srgb[..., 2] - b)\n \n     \"\"\"\n     Obtain least squares fit\ndiff --git a/utils/raspberrypi/ctt/ctt_geq.py b/utils/raspberrypi/ctt/ctt_geq.py\nindex f8395e437fe6..175986409edd 100644\n--- a/utils/raspberrypi/ctt/ctt_geq.py\n+++ b/utils/raspberrypi/ctt/ctt_geq.py\n@@ -20,7 +20,7 @@ def geq_fit(Cam, plot):\n     Fits geq model by looking at difference\n     between greens in macbeth patches\n     \"\"\"\n-    geqs = np.array([ geq(Cam, Img)*Img.againQ8_norm for Img in imgs ])\n+    geqs = np.array([geq(Cam, Img)*Img.againQ8_norm for Img in imgs])\n     Cam.log += '\\nProcessed all images'\n     geqs = geqs.reshape((-1, 2))\n     \"\"\"\ndiff --git a/utils/raspberrypi/ctt/ctt_ransac.py b/utils/raspberrypi/ctt/ctt_ransac.py\nindex 62d5cde826aa..a15136254a9e 100644\n--- a/utils/raspberrypi/ctt/ctt_ransac.py\n+++ b/utils/raspberrypi/ctt/ctt_ransac.py\n@@ -25,7 +25,7 @@ def get_square_verts(c_err = 0.05, scale = scale):\n     c3 = (x_max, y_max)\n     c4 = (x_max, 0)\n     mac_norm = np.array((c1, c2, c3, c4), np.float32)\n-    mac_norm = np.array([ mac_norm ])\n+    mac_norm = np.array([mac_norm])\n \n     square_verts = []\n     square_0 = np.array(((0, 0), (0, side),\n","prefixes":["libcamera-devel","02/24"]}