Show a patch.

GET /api/patches/3757/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 3757,
    "url": "https://patchwork.libcamera.org/api/patches/3757/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3757/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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-4-laurent.pinchart@ideasonboard.com>",
    "date": "2020-05-12T00:03:01",
    "name": "[libcamera-devel,03/24] utils: raspberrypi: ctt: Fix pycodestyle E203",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "429e775ca697813b94c25e2ca41056f96bd4be80",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/3757/mbox/",
    "series": [
        {
            "id": 897,
            "url": "https://patchwork.libcamera.org/api/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/3757/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3757/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<laurent.pinchart@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1A57D603DD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 May 2020 02:03:34 +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 8979433E;\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=\"KblTadHX\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1589241813;\n\tbh=Kh4M/7iI1kfevDFdWopkc+JbYL9m2fnRhO1IBmSJfdY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=KblTadHXsBLdt09zN/PgmqGJmQI5IGN2WH+6pUA7OD+457nxyPyQlcEN4W7ycTeH8\n\tnUdxxYeez68OH0z2XeGNP08DC6FnzNNC7lHPKg66gMvE4xzECchFCMKXhx1hu8u9Ju\n\tL9jd4BNuhYDng/NqfPqY2ebkRPVaY++TdvZzcgHI=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 12 May 2020 03:03:01 +0300",
        "Message-Id": "<20200512000322.11753-4-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 03/24] utils: raspberrypi: ctt: Fix\n\tpycodestyle E203",
        "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": "E203 whitespace before ':'\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n utils/raspberrypi/ctt/ctt.py                  | 70 +++++++++----------\n utils/raspberrypi/ctt/ctt_awb.py              |  2 +-\n utils/raspberrypi/ctt/ctt_ccm.py              |  4 +-\n utils/raspberrypi/ctt/ctt_image_load.py       | 10 +--\n utils/raspberrypi/ctt/ctt_macbeth_locator.py  |  2 +-\n .../raspberrypi/ctt/ctt_pretty_print_json.py  |  2 +-\n 6 files changed, 45 insertions(+), 45 deletions(-)",
    "diff": "diff --git a/utils/raspberrypi/ctt/ctt.py b/utils/raspberrypi/ctt/ctt.py\nindex ba2dbd713e55..97cadfe8ab82 100755\n--- a/utils/raspberrypi/ctt/ctt.py\n+++ b/utils/raspberrypi/ctt/ctt.py\n@@ -78,78 +78,78 @@ class Camera:\n         initial json dict populated by uncalibrated values\n         \"\"\"\n         self.json = {\n-            \"rpi.black_level\" : {\n-                \"black_level\" : 4096\n+            \"rpi.black_level\": {\n+                \"black_level\": 4096\n             },\n-            \"rpi.dpc\" : {\n+            \"rpi.dpc\": {\n             },\n-            \"rpi.lux\" : {\n+            \"rpi.lux\": {\n                 \"reference_shutter_speed\": 10000,\n                 \"reference_gain\": 1,\n                 \"reference_aperture\": 1.0\n                 },\n-            \"rpi.noise\" : {\n+            \"rpi.noise\": {\n             },\n-            \"rpi.geq\" : {\n+            \"rpi.geq\": {\n             },\n             \"rpi.sdn\": {\n             },\n             \"rpi.awb\": {\n-                \"priors\" : [\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                 ],\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+                \"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                 },\n-                \"bayes\" : 1\n+                \"bayes\": 1\n             },\n-            \"rpi.agc\" : {\n-                \"metering_modes\" : {\n-                    \"centre-weighted\" : {\n-                        \"weights\" : [3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0]\n+            \"rpi.agc\": {\n+                \"metering_modes\": {\n+                    \"centre-weighted\": {\n+                        \"weights\": [3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0]\n                     },\n-                    \"spot\" : {\n-                        \"weights\" : [2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n+                    \"spot\": {\n+                        \"weights\": [2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n                     },\n                     \"matrix\": {\n-                        \"weights\" : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\n+                        \"weights\": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]\n                     }\n                 },\n-                \"exposure_modes\" : {\n-                    \"normal\" : {\n-                        \"shutter\" : [100, 10000, 30000, 60000, 120000],\n-                        \"gain\"    : [1.0, 2.0,   4.0,   6.0,   6.0]\n+                \"exposure_modes\": {\n+                    \"normal\": {\n+                        \"shutter\": [100, 10000, 30000, 60000, 120000],\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                     }\n                 },\n-                \"constraint_modes\" : {\n-                    \"normal\" : [\n-                        {\"bound\" : \"LOWER\", \"q_lo\" : 0.98, \"q_hi\" : 1.0, \"y_target\" : [0, 0.5, 1000, 0.5]}\n+                \"constraint_modes\": {\n+                    \"normal\": [\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                     ]\n                 },\n-                \"y_target\" : [0, 0.16, 1000, 0.165, 10000, 0.17]\n+                \"y_target\": [0, 0.16, 1000, 0.165, 10000, 0.17]\n             },\n             \"rpi.alsc\": {\n-                'omega' : 1.3,\n-                'n_iter' : 100,\n-                'luminance_strength' : 0.7,\n+                'omega': 1.3,\n+                'n_iter': 100,\n+                'luminance_strength': 0.7,\n             },\n-            \"rpi.contrast\" : {\n+            \"rpi.contrast\": {\n                 \"ce_enable\": 1,\n                 \"gamma_curve\": [\n                     0,     0,\ndiff --git a/utils/raspberrypi/ctt/ctt_awb.py b/utils/raspberrypi/ctt/ctt_awb.py\nindex 9a92033bf2db..297ba178b35f 100644\n--- a/utils/raspberrypi/ctt/ctt_awb.py\n+++ b/utils/raspberrypi/ctt/ctt_awb.py\n@@ -197,7 +197,7 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):\n     iterate backwards over list for easier indexing\n     \"\"\"\n     i = len(c_fit) - 1\n-    while i > 0 :\n+    while i > 0:\n         if c_fit[i] > c_fit[i-1]:\n             Cam.log += '\\nColour temperature increase found\\n'\n             Cam.log += '{} K at r = {} to '.format(c_fit[i-1], r_fit[i-1])\ndiff --git a/utils/raspberrypi/ctt/ctt_ccm.py b/utils/raspberrypi/ctt/ctt_ccm.py\nindex 44fb81885368..769603b947c5 100644\n--- a/utils/raspberrypi/ctt/ctt_ccm.py\n+++ b/utils/raspberrypi/ctt/ctt_ccm.py\n@@ -148,8 +148,8 @@ def ccm(Cam, cal_cr_list, cal_cb_list):\n     ccms = []\n     for i in sorted_ccms:\n         ccms.append({\n-            'ct' : i[0],\n-            'ccm' : i[1]\n+            'ct': i[0],\n+            'ccm': i[1]\n         })\n     return ccms\n \ndiff --git a/utils/raspberrypi/ctt/ctt_image_load.py b/utils/raspberrypi/ctt/ctt_image_load.py\nindex 7d097118c16c..035256e3fd0b 100644\n--- a/utils/raspberrypi/ctt/ctt_image_load.py\n+++ b/utils/raspberrypi/ctt/ctt_image_load.py\n@@ -45,11 +45,11 @@ class Image:\n         Channel order depending on bayer pattern\n         \"\"\"\n         bayer_case = {\n-            0 : (0, 1, 2, 3), #red\n-            1 : (2, 0, 3, 1), #green next to red\n-            2 : (3, 2, 1, 0), #green next to blue\n-            3 : (1, 0, 3, 2), #blue\n-            128 : (0, 1, 2, 3) #arbitrary order for greyscale casw\n+            0: (0, 1, 2, 3), #red\n+            1: (2, 0, 3, 1), #green next to red\n+            2: (3, 2, 1, 0), #green next to blue\n+            3: (1, 0, 3, 2), #blue\n+            128: (0, 1, 2, 3) #arbitrary order for greyscale casw\n         }\n         self.order = bayer_case[self.pattern]\n \ndiff --git a/utils/raspberrypi/ctt/ctt_macbeth_locator.py b/utils/raspberrypi/ctt/ctt_macbeth_locator.py\nindex 591459aa4cc5..949e3686bc15 100644\n--- a/utils/raspberrypi/ctt/ctt_macbeth_locator.py\n+++ b/utils/raspberrypi/ctt/ctt_macbeth_locator.py\n@@ -180,7 +180,7 @@ def find_macbeth(Cam, img, mac_config=(0, 0)):\n \n     if small_chart:\n \n-        if cor < 0.75 and d_best > 1 :\n+        if cor < 0.75 and d_best > 1:\n             imgs = []\n             shape = list(img.shape[:2])\n             w, h = shape\ndiff --git a/utils/raspberrypi/ctt/ctt_pretty_print_json.py b/utils/raspberrypi/ctt/ctt_pretty_print_json.py\nindex 44a9311b5e76..63b042de58d4 100644\n--- a/utils/raspberrypi/ctt/ctt_pretty_print_json.py\n+++ b/utils/raspberrypi/ctt/ctt_pretty_print_json.py\n@@ -61,7 +61,7 @@ def process_char(c, fout, state):\n     state[\"skipnewline\"] = (c == '[')\n \n def pretty_print_json(str_in, output_filename):\n-    state = {\"indent\": 0, \"inarray\": [False], \"arraycount\": [], \"skipnewline\" : True}\n+    state = {\"indent\": 0, \"inarray\": [False], \"arraycount\": [], \"skipnewline\": True}\n     with open(output_filename, \"w\") as fout:\n         process_file(str_in, fout, state)\n \n",
    "prefixes": [
        "libcamera-devel",
        "03/24"
    ]
}