[libcamera-devel] [PATCH v2 07/11] [WIP] utils: libtuning: parsers: Add yaml parser

Paul Elder paul.elder at ideasonboard.com
Thu Nov 10 08:16:20 CET 2022


On Wed, Nov 09, 2022 at 12:38:20PM +0200, Laurent Pinchart wrote:
> Hi Paul,
> 
> Thank you for the patch.
> 
> On Sat, Oct 22, 2022 at 03:23:06PM +0900, Paul Elder via libcamera-devel wrote:
> > Add a parser to libtuning for parsing configuration files in yaml
> > format.
> > 
> > Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> > 
> > ---
> > Obviously this doesn't work. Technically it's fine because the only user
> > of the yaml parser at the moment works fine with no input configuration
> > file.
> 
> Do we need to merge this, or can it be left out for now ? I'm fine
> either way, so

We actually don't, but I think it's better to keep it in otherwise I'm
certain we'll forget about it later.

Should I return empty or raise NotImplementedError?

> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>


Thanks,

Paul

> 
> > ---
> >  utils/tuning/libtuning/parsers/__init__.py    |  1 +
> >  utils/tuning/libtuning/parsers/yaml_parser.py | 15 +++++++++++++++
> >  2 files changed, 16 insertions(+)
> >  create mode 100644 utils/tuning/libtuning/parsers/yaml_parser.py
> > 
> > diff --git a/utils/tuning/libtuning/parsers/__init__.py b/utils/tuning/libtuning/parsers/__init__.py
> > index 9d20d2fc..022c1e5d 100644
> > --- a/utils/tuning/libtuning/parsers/__init__.py
> > +++ b/utils/tuning/libtuning/parsers/__init__.py
> > @@ -3,3 +3,4 @@
> >  # Copyright (C) 2022, Paul Elder <paul.elder at ideasonboard.com>
> >  
> >  from libtuning.parsers.raspberrypi_parser import RaspberryPiParser
> > +from libtuning.parsers.yaml_parser import YamlParser
> > diff --git a/utils/tuning/libtuning/parsers/yaml_parser.py b/utils/tuning/libtuning/parsers/yaml_parser.py
> > new file mode 100644
> > index 00000000..e2ce6e20
> > --- /dev/null
> > +++ b/utils/tuning/libtuning/parsers/yaml_parser.py
> > @@ -0,0 +1,15 @@
> > +# SPDX-License-Identifier: GPL-2.0-or-later
> > +#
> > +# Copyright (C) 2022, Paul Elder <paul.elder at ideasonboard.com>
> > +
> > +from .parser import Parser
> > +
> > +
> > +class YamlParser(Parser):
> > +    def __init__(self):
> > +        super().__init__()
> > +
> > +    # todo Implement this (it's fine for now as we don't need a config for
> > +    # rkisp1 LSC)
> > +    def _parse(self, config_file, modules):
> > +        return {}, []


More information about the libcamera-devel mailing list