Patch Detail
Show a patch.
GET /api/1.1/patches/3763/?format=api
{ "id": 3763, "url": "https://patchwork.libcamera.org/api/1.1/patches/3763/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3763/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "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-10-laurent.pinchart@ideasonboard.com>", "date": "2020-05-12T00:03:07", "name": "[libcamera-devel,09/24] utils: raspberrypi: ctt: Fix pycodestyle E228", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "49960e491952fcde32660b6013b03db6db209c90", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/3763/mbox/", "series": [ { "id": 897, "url": "https://patchwork.libcamera.org/api/1.1/series/897/?format=api", "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/3763/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3763/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 49AB060DFD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 May 2020 02:03:37 +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 CC37511F3;\n\tTue, 12 May 2020 02:03:36 +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=\"bmOpZ7l7\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1589241817;\n\tbh=4sMYn1cJBGuuSh8FWbz9/sstOgpWR4dBKg1PDOeKqV8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=bmOpZ7l7K/tyb4gCGXHPwl3e25o5q5KYGBw4TtFSBLg88o9uBcF1sV0LgP24vJuIn\n\tfKSPZ1ikWK7gvBTwzZt/srypvddjVYSx4kqk+p3GyFWKBrmpcmOlc5cJrqsSfJsUot\n\tgjzQpqE62jXICkaVmE6iDt3zJYWr52tPc2QQ0aKE=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 12 May 2020 03:03:07 +0300", "Message-Id": "<20200512000322.11753-10-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 09/24] utils: raspberrypi: ctt: Fix\n\tpycodestyle E228", "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:39 -0000" }, "content": "E228 missing whitespace around modulo operator\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n utils/raspberrypi/ctt/ctt_alsc.py | 12 ++++++------\n utils/raspberrypi/ctt/ctt_awb.py | 10 +++++-----\n utils/raspberrypi/ctt/ctt_ccm.py | 4 ++--\n utils/raspberrypi/ctt/ctt_image_load.py | 12 ++++++------\n utils/raspberrypi/ctt/ctt_tools.py | 2 +-\n 5 files changed, 20 insertions(+), 20 deletions(-)", "diff": "diff --git a/utils/raspberrypi/ctt/ctt_alsc.py b/utils/raspberrypi/ctt/ctt_alsc.py\nindex d6e1020f1ccc..e768f8d648a1 100644\n--- a/utils/raspberrypi/ctt/ctt_alsc.py\n+++ b/utils/raspberrypi/ctt/ctt_alsc.py\n@@ -61,10 +61,10 @@ def alsc_all(Cam, do_alsc_colour, plot):\n \"\"\"\n force numbers to be stored to 3dp.... :(\n \"\"\"\n- t_r = np.where((100*t_r)%1 <= 0.05, t_r+0.001, t_r)\n- t_b = np.where((100*t_b)%1 <= 0.05, t_b+0.001, t_b)\n- t_r = np.where((100*t_r)%1 >= 0.95, t_r-0.001, t_r)\n- t_b = np.where((100*t_b)%1 >= 0.95, t_b-0.001, t_b)\n+ t_r = np.where((100*t_r) % 1 <= 0.05, t_r+0.001, t_r)\n+ t_b = np.where((100*t_b) % 1 <= 0.05, t_b+0.001, t_b)\n+ t_r = np.where((100*t_r) % 1 >= 0.95, t_r-0.001, t_r)\n+ t_b = np.where((100*t_b) % 1 >= 0.95, t_b-0.001, t_b)\n t_r = np.round(t_r, 3)\n t_b = np.round(t_b, 3)\n r_corners = (t_r[0], t_r[15], t_r[-1], t_r[-16])\n@@ -95,8 +95,8 @@ def alsc_all(Cam, do_alsc_colour, plot):\n average all values for luminance shading and return one table for all temperatures\n \"\"\"\n lum_lut = np.mean(list_cg, axis=0)\n- lum_lut = np.where((100*lum_lut)%1 <= 0.05, lum_lut+0.001, lum_lut)\n- lum_lut = np.where((100*lum_lut)%1 >= 0.95, lum_lut-0.001, lum_lut)\n+ lum_lut = np.where((100*lum_lut) % 1 <= 0.05, lum_lut+0.001, lum_lut)\n+ lum_lut = np.where((100*lum_lut) % 1 >= 0.95, lum_lut-0.001, lum_lut)\n lum_lut = list(np.round(lum_lut, 3))\n \n \"\"\"\ndiff --git a/utils/raspberrypi/ctt/ctt_awb.py b/utils/raspberrypi/ctt/ctt_awb.py\nindex 3abafbf550b0..58ef8432fb86 100644\n--- a/utils/raspberrypi/ctt/ctt_awb.py\n+++ b/utils/raspberrypi/ctt/ctt_awb.py\n@@ -183,10 +183,10 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n \"\"\"\n round to 4dp\n \"\"\"\n- r_fit = np.where((1000*r_fit)%1 <= 0.05, r_fit+0.0001, r_fit)\n- r_fit = np.where((1000*r_fit)%1 >= 0.95, r_fit-0.0001, r_fit)\n- b_fit = np.where((1000*b_fit)%1 <= 0.05, b_fit+0.0001, b_fit)\n- b_fit = np.where((1000*b_fit)%1 >= 0.95, b_fit-0.0001, b_fit)\n+ r_fit = np.where((1000*r_fit) % 1 <= 0.05, r_fit+0.0001, r_fit)\n+ r_fit = np.where((1000*r_fit) % 1 >= 0.95, r_fit-0.0001, r_fit)\n+ b_fit = np.where((1000*b_fit) % 1 <= 0.05, b_fit+0.0001, b_fit)\n+ b_fit = np.where((1000*b_fit) % 1 >= 0.95, b_fit-0.0001, b_fit)\n r_fit = np.round(r_fit, 4)\n b_fit = np.round(b_fit, 4)\n \"\"\"\n@@ -326,7 +326,7 @@ def get_alsc_patches(Img, colour_cals, grey=True):\n if img colour is below minimum or above maximum alsc calibration colour, simply\n pick extreme closest to img colour\n \"\"\"\n- if pos%(len(cts)) == 0:\n+ if pos % len(cts) == 0:\n \"\"\"\n this works because -0 = 0 = first and -1 = last index\n \"\"\"\ndiff --git a/utils/raspberrypi/ctt/ctt_ccm.py b/utils/raspberrypi/ctt/ctt_ccm.py\nindex 52fd9744332a..adc4d290ae7e 100644\n--- a/utils/raspberrypi/ctt/ctt_ccm.py\n+++ b/utils/raspberrypi/ctt/ctt_ccm.py\n@@ -135,8 +135,8 @@ def ccm(Cam, cal_cr_list, cal_cb_list):\n \"\"\"\n for k, v in ccm_tab.items():\n tab = np.mean(v, axis=0)\n- tab = np.where((10000*tab)%1 <= 0.05, tab+0.00001, tab)\n- tab = np.where((10000*tab)%1 >= 0.95, tab-0.00001, tab)\n+ tab = np.where((10000*tab) % 1 <= 0.05, tab+0.00001, tab)\n+ tab = np.where((10000*tab) % 1 >= 0.95, tab-0.00001, tab)\n ccm_tab[k] = list(np.round(tab, 5))\n Cam.log += '\\nMatrix calculated for colour temperature of {} K'.format(k)\n \ndiff --git a/utils/raspberrypi/ctt/ctt_image_load.py b/utils/raspberrypi/ctt/ctt_image_load.py\nindex 035256e3fd0b..584e0f8ebaa5 100644\n--- a/utils/raspberrypi/ctt/ctt_image_load.py\n+++ b/utils/raspberrypi/ctt/ctt_image_load.py\n@@ -112,10 +112,10 @@ class Image:\n \"\"\"\n assemble 10 bit numbers\n \"\"\"\n- ch0 = np.left_shift((np.left_shift(ba0, 2) + (ba4%4)), 6)\n- ch1 = np.left_shift((np.left_shift(ba1, 2) + (np.right_shift(ba4, 2)%4)), 6)\n- ch2 = np.left_shift((np.left_shift(ba2, 2) + (np.right_shift(ba4, 4)%4)), 6)\n- ch3 = np.left_shift((np.left_shift(ba3, 2) + (np.right_shift(ba4, 6)%4)), 6)\n+ ch0 = np.left_shift((np.left_shift(ba0, 2) + (ba4 % 4)), 6)\n+ ch1 = np.left_shift((np.left_shift(ba1, 2) + (np.right_shift(ba4, 2) % 4)), 6)\n+ ch2 = np.left_shift((np.left_shift(ba2, 2) + (np.right_shift(ba4, 4) % 4)), 6)\n+ ch3 = np.left_shift((np.left_shift(ba3, 2) + (np.right_shift(ba4, 6) % 4)), 6)\n \"\"\"\n interleave bits\n \"\"\"\n@@ -146,8 +146,8 @@ class Image:\n ba0 = raw[..., 0:3*((self.w+1)>>1):3]\n ba1 = raw[..., 1:3*((self.w+1)>>1):3]\n ba2 = raw[..., 2:3*((self.w+1)>>1):3]\n- ch0 = np.left_shift((np.left_shift(ba0, 4) + ba2%16), 4)\n- ch1 = np.left_shift((np.left_shift(ba1, 4) + (np.right_shift(ba2, 4))%16), 4)\n+ ch0 = np.left_shift((np.left_shift(ba0, 4) + ba2 % 16), 4)\n+ ch1 = np.left_shift((np.left_shift(ba1, 4) + (np.right_shift(ba2, 4)) % 16), 4)\n mat = np.empty((self.h, self.w), dtype=ch0.dtype)\n mat[..., 0::2] = ch0\n mat[..., 1::2] = ch1\ndiff --git a/utils/raspberrypi/ctt/ctt_tools.py b/utils/raspberrypi/ctt/ctt_tools.py\nindex f00f2bbc8299..e5871b60d6a2 100644\n--- a/utils/raspberrypi/ctt/ctt_tools.py\n+++ b/utils/raspberrypi/ctt/ctt_tools.py\n@@ -53,7 +53,7 @@ argument parser\n \"\"\"\n def parse_input():\n arguments = sys.argv[1:]\n- if len(arguments)%2 != 0:\n+ if len(arguments) % 2 != 0:\n raise ArgError('\\n\\nERROR! Enter value for each arguent passed.')\n params = arguments[0::2]\n vals = arguments[1::2]\n", "prefixes": [ "libcamera-devel", "09/24" ] }