[{"id":30134,"web_url":"https://patchwork.libcamera.org/comment/30134/","msgid":"<20240628230737.GH30900@pendragon.ideasonboard.com>","date":"2024-06-28T23:07:37","subject":"Re: [PATCH v2 10/25] libtuning: Implement a minimal yaml parser","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Stefan,\n\nThank you for the patch.\n\nOn Fri, Jun 28, 2024 at 12:47:03PM +0200, Stefan Klug wrote:\n> At the moment this just reads the yaml file and returns it verbatim.\n> This needs to evolve further in the near future.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n> ---\n>  utils/tuning/config-example.yaml              | 12 ++++++++++++\n>  utils/tuning/libtuning/parsers/yaml_parser.py |  9 ++++++---\n>  2 files changed, 18 insertions(+), 3 deletions(-)\n>  create mode 100644 utils/tuning/config-example.yaml\n> \n> diff --git a/utils/tuning/config-example.yaml b/utils/tuning/config-example.yaml\n> new file mode 100644\n> index 000000000000..1b7f52cd2fff\n> --- /dev/null\n> +++ b/utils/tuning/config-example.yaml\n> @@ -0,0 +1,12 @@\n> +general:\n> +  disable: []\n> +  plot: []\n> +  alsc:\n> +    do_alsc_colour: 1\n> +    luminance_strength: 0.5\n> +  awb:\n> +    greyworld: 0\n> +  macbeth:\n> +    small: 1\n> +    show: 0\n> +#  blacklevel: 32\n> \\ No newline at end of file\n\nThis will need to be documented. I suppose it will come later.\n\n> diff --git a/utils/tuning/libtuning/parsers/yaml_parser.py b/utils/tuning/libtuning/parsers/yaml_parser.py\n> index 244db24daeb1..71c30180d29f 100644\n> --- a/utils/tuning/libtuning/parsers/yaml_parser.py\n> +++ b/utils/tuning/libtuning/parsers/yaml_parser.py\n> @@ -5,13 +5,16 @@\n>  # Parser for YAML format config file\n>  \n>  from .parser import Parser\n> +import yaml\n>  \n>  \n>  class YamlParser(Parser):\n>      def __init__(self):\n>          super().__init__()\n>  \n> -    # \\todo Implement this (it's fine for now as we don't need a config for\n> -    # rkisp1 LSC, which is the only user of this so far)\n>      def parse(self, config_file: str, modules: list) -> (dict, list):\n> -        return {}, []\n> +        # dummy implementation that just reads the file\n\ns/dummy/Dummy/\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +        with open(config_file, 'r') as f:\n> +            config = yaml.safe_load(f)\n> +\n> +        return config, []","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 26999BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 Jun 2024 23:08:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CD6FF62C9B;\n\tSat, 29 Jun 2024 01:08:00 +0200 (CEST)","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 9432F619E8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 29 Jun 2024 01:07:58 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7EBEC471;\n\tSat, 29 Jun 2024 01:07:33 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"jS2KWzDD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1719616053;\n\tbh=b76v5xj0n/apZxtZLSSIH5wCeBbYmDMs5itMbYJtx1I=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=jS2KWzDDIWzrhxBVPSr20gf0UxXotSUKa5ATbJehK8Z8WghyypISzvwnAtLBZy/Kz\n\t64AzlMQ1NtjmREs3l3u+erimy7Tl2UD0fop2qLBXTcKluSFb2sm3zszg+75V2rKNFk\n\toJ5q7jiLohl7nW0kCeXz8u3HCiO5KZX3zA373e8A=","Date":"Sat, 29 Jun 2024 02:07:37 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tPaul Elder <paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v2 10/25] libtuning: Implement a minimal yaml parser","Message-ID":"<20240628230737.GH30900@pendragon.ideasonboard.com>","References":"<20240628104828.2928109-1-stefan.klug@ideasonboard.com>\n\t<20240628104828.2928109-11-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240628104828.2928109-11-stefan.klug@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]