get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 109301,
    "url": "http://patches.dpdk.org/api/patches/109301/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220406151903.2916254-3-juraj.linkes@pantheon.tech/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20220406151903.2916254-3-juraj.linkes@pantheon.tech>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220406151903.2916254-3-juraj.linkes@pantheon.tech",
    "date": "2022-04-06T15:18:42",
    "name": "[RFC,v1,02/23] dts: merge DTS framework/plotting.py to DPDK",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "5e50088bd9661e08ae18b6720e168d0c7f1df176",
    "submitter": {
        "id": 1626,
        "url": "http://patches.dpdk.org/api/people/1626/?format=api",
        "name": "Juraj Linkeš",
        "email": "juraj.linkes@pantheon.tech"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220406151903.2916254-3-juraj.linkes@pantheon.tech/mbox/",
    "series": [
        {
            "id": 22381,
            "url": "http://patches.dpdk.org/api/series/22381/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22381",
            "date": "2022-04-06T15:18:40",
            "name": "merge DTS test resource files to DPDK",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/22381/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/109301/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/109301/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C5FEEA0509;\n\tWed,  6 Apr 2022 17:19:20 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7F94B4288D;\n\tWed,  6 Apr 2022 17:19:10 +0200 (CEST)",
            "from lb.pantheon.sk (lb.pantheon.sk [46.229.239.20])\n by mails.dpdk.org (Postfix) with ESMTP id 6E3C542862\n for <dev@dpdk.org>; Wed,  6 Apr 2022 17:19:08 +0200 (CEST)",
            "from localhost (localhost [127.0.0.1])\n by lb.pantheon.sk (Postfix) with ESMTP id 5AC78184FF6;\n Wed,  6 Apr 2022 17:19:07 +0200 (CEST)",
            "from lb.pantheon.sk ([127.0.0.1])\n by localhost (lb.pantheon.sk [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id aZEy-w6KGo0k; Wed,  6 Apr 2022 17:19:06 +0200 (CEST)",
            "from entguard.lab.pantheon.local (unknown [46.229.239.141])\n by lb.pantheon.sk (Postfix) with ESMTP id AAA2C184FEE;\n Wed,  6 Apr 2022 17:19:04 +0200 (CEST)"
        ],
        "X-Virus-Scanned": "amavisd-new at siecit.sk",
        "From": "=?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>",
        "To": "thomas@monjalon.net, david.marchand@redhat.com,\n Honnappa.Nagarahalli@arm.com, ohilyard@iol.unh.edu, lijuan.tu@intel.com",
        "Cc": "dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>",
        "Subject": "[RFC PATCH v1 02/23] dts: merge DTS framework/plotting.py to DPDK",
        "Date": "Wed,  6 Apr 2022 15:18:42 +0000",
        "Message-Id": "<20220406151903.2916254-3-juraj.linkes@pantheon.tech>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220406151903.2916254-1-juraj.linkes@pantheon.tech>",
        "References": "<20220406151903.2916254-1-juraj.linkes@pantheon.tech>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "---\n dts/framework/plotting.py | 246 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 246 insertions(+)\n create mode 100644 dts/framework/plotting.py",
    "diff": "diff --git a/dts/framework/plotting.py b/dts/framework/plotting.py\nnew file mode 100644\nindex 0000000000..83499061ef\n--- /dev/null\n+++ b/dts/framework/plotting.py\n@@ -0,0 +1,246 @@\n+# BSD LICENSE\n+#\n+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+# All rights reserved.\n+#\n+# Redistribution and use in source and binary forms, with or without\n+# modification, are permitted provided that the following conditions\n+# are met:\n+#\n+#   * Redistributions of source code must retain the above copyright\n+#     notice, this list of conditions and the following disclaimer.\n+#   * Redistributions in binary form must reproduce the above copyright\n+#     notice, this list of conditions and the following disclaimer in\n+#     the documentation and/or other materials provided with the\n+#     distribution.\n+#   * Neither the name of Intel Corporation nor the names of its\n+#     contributors may be used to endorse or promote products derived\n+#     from this software without specific prior written permission.\n+#\n+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+\n+import os\n+import shutil\n+\n+from docutils.parsers.rst.directives import path\n+\n+import framework.plotgraph as plotgraph\n+import framework.utils as utils\n+\n+from .exception import VerifyFailure\n+from .plotgraph import Plot2DGraph\n+from .rst import path2Result\n+\n+\"\"\"\n+Generate Plots for performance test results\n+\"\"\"\n+\n+\n+class tableData(object):\n+    def __init__(self):\n+        self.headers = []\n+        \"\"\"\n+        Each data array corresponds to a column related to one of the headers above\n+        \"\"\"\n+        self.data = []\n+\n+\n+class Plotting(object):\n+\n+    path_2_result = path2Result\n+    plots_subfolder = \"images\"\n+    image_format = \"png\"\n+\n+    default_bar_colours = [\n+        \"#f70202\",\n+        \"#0f0b0b\",\n+        \"#123eed\",\n+        \"#07601b\",\n+        \"#36f760\",\n+        \"#87210d\",\n+        \"#512f28\",\n+        \"#11c6b1\",\n+        \"#45f94e\",\n+        \"#f94566\",\n+    ]\n+\n+    default_line_markers = [\"o\"]\n+\n+    default_line_styles = [\"--\"]\n+\n+    def __init__(self, crb, target, nic):\n+\n+        # Ensure the folder exist\n+        try:\n+\n+            path = \"/\".join(\n+                [Plotting.path_2_result, crb, target, nic, Plotting.plots_subfolder]\n+            )\n+\n+            if not os.path.exists(path):\n+                os.makedirs(path)\n+\n+            self.plots_path = path\n+\n+        except Exception as e:\n+            raise VerifyFailure(\"Plot Error: \" + str(e))\n+\n+    def clear_all_plots(self, crb, target):\n+        shutil.rmtree(self.plots_path, True)\n+\n+    def create_bars_plot(\n+        self,\n+        image_filename,\n+        plot_title,\n+        xdata,\n+        ydata,\n+        xlabel=\"\",\n+        ylabel=\"\",\n+        legend=[],\n+        bar_colours=default_bar_colours,\n+    ):\n+\n+        for yseries in ydata:\n+            if len(xdata) != len(yseries):\n+                print(\n+                    utils.RED(\n+                        \"The number of items in X axis (%s) and Y axis (%s) does not match.\"\n+                        % (xdata, ydata)\n+                    )\n+                )\n+                return \"\"\n+\n+        image_path = \"%s/%s.%s\" % (\n+            self.plots_path,\n+            image_filename,\n+            Plotting.image_format,\n+        )\n+\n+        pgraph = Plot2DGraph()\n+        pgraph.resetMe()\n+\n+        # Set the number of bars, ydata contains a array per set of data\n+        pgraph.setNumPlots(len(ydata))\n+        pgraph.setNumSubplots(1)\n+\n+        pgraph.setColors(bar_colours)\n+        pgraph.addBarYlabel(0, ylabel)\n+        pgraph.setBarLegends(0, legend)\n+\n+        # For each value in the x axis add corresponding bar (array in ydata)\n+        for xvalue in range(len(xdata)):\n+            yvalues = [_[xvalue] for _ in ydata]\n+            pgraph.addBarData(0, xdata[xvalue], yvalues)\n+\n+        # Dynamic adjustment of the bar widths for better plot appearance\n+        bar_width = 0.30 - 0.005 * ((len(xdata) * len(legend)) - 4)\n+        pgraph.setBarWidth(0, bar_width)\n+\n+        pgraph.generateBar(plotName=image_path, title=plot_title)\n+\n+        return image_path\n+\n+    def create_lines_plot(\n+        self,\n+        image_filename,\n+        plot_title,\n+        xdata,\n+        ydata,\n+        xticks=[],\n+        yticks=[],\n+        xlabel=\"\",\n+        ylabel=\"\",\n+        legend=[],\n+        line_colours=default_bar_colours,\n+        line_markers=default_line_markers,\n+        line_styles=default_line_styles,\n+        addHline=False,\n+        hLine={},\n+        testing=False,\n+    ):\n+\n+        image_path = \"%s/%s.%s\" % (\n+            self.plots_path,\n+            image_filename,\n+            Plotting.image_format,\n+        )\n+\n+        pgraph = Plot2DGraph()\n+        pgraph.resetMe()\n+\n+        numPlots = len(ydata) / len(xticks)\n+        numticks = len(xticks)\n+\n+        # Set the number of bars, ydata contains a array per set of data\n+        pgraph.setNumPlots(numPlots)\n+        # TODO more than one plot per figure needs to be tested\n+        pgraph.setNumSubplots(1)\n+\n+        # workaround\n+        if numPlots > len(line_colours):\n+            print(\"WARNING - numPlots > len(line_colours)\")\n+            r = 0x00\n+            g = 0x66\n+            b = 0xFF\n+            for _ in range(numPlots - len(line_colours)):\n+                r = r % 256\n+                g = g % 256\n+                b = b % 256\n+                _ = \"#%0.2x%0.2x%0.2x\" % (r, g, b)\n+                line_colours.append(_)\n+                r += 7\n+                g -= 10\n+                b -= 9\n+\n+        line_markers = line_markers * numPlots\n+        line_styles = line_styles * numPlots\n+\n+        pgraph.setColors(line_colours)\n+        pgraph.setMarkers(line_markers)\n+        pgraph.setLineStyle(line_styles)\n+\n+        pgraph.addBarYlabel(0, ylabel)\n+        pgraph.setBarLegends(0, legend)\n+\n+        # For each value in the x axis add corresponding bar (array in ydata)\n+        for i in list(range(numPlots)):\n+            yDataStart = i * numticks\n+            pgraph.addPlotData(\n+                i,\n+                \"Number of active pipes per output port\",\n+                ylabel,\n+                xticks,\n+                [],\n+                xdata,\n+                ydata[yDataStart : (yDataStart + numticks)],\n+                [],\n+                [],\n+            )\n+\n+        pgraph.xLen = 0.6\n+        pgraph.titleFontSize = 18\n+        pgraph.titleYOffset = 0.96\n+        pgraph.titleXOffset = 0.35\n+\n+        if addHline:\n+            pgraph.horizontalLine = True\n+            pgraph.hLineName = hLine[\"name\"]\n+            pgraph.hLine = hLine[\"value\"]\n+            pgraph.hLineBoxX = hLine[\"boxXvalue\"]\n+            pgraph.hLineBoxY = hLine[\"boxYvalue\"]\n+\n+        pgraph.generatePlot(\n+            plotName=image_path, keys=legend, title=plot_title, firstYvalue=1\n+        )\n+\n+        return image_path\n",
    "prefixes": [
        "RFC",
        "v1",
        "02/23"
    ]
}