From patchwork Fri Jun 28 10:47:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20476 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4680ABD87C for ; Fri, 28 Jun 2024 10:49:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EC92D6335E; Fri, 28 Jun 2024 12:49:28 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="MW5+CzlP"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8AD43632EA for ; Fri, 28 Jun 2024 12:49:27 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:82ab:924:d918:cd24]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 07893BEB; Fri, 28 Jun 2024 12:49:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1719571743; bh=6bjG7LEbOOfvAQ0tWSTwPCyaexrI600qYVgZiwLqRbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MW5+CzlPKW7h0M1c38Xau6evnRV5ScwrKY9CJV6TczsTfqxImu20Q5b8SO8XKkbwc /Kabgmb1TuAriiYx11m0aiV0xyKQ+NrSslWbpNvgIOM3G9KTSE6BTlRNHIGN1gLnl8 sxgmDLdODEASgp+NBKzMtraoQLVsrdVlG6UN/yJE= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v2 17/25] libtuning: Only warn if processing returns None Date: Fri, 28 Jun 2024 12:47:10 +0200 Message-ID: <20240628104828.2928109-18-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240628104828.2928109-1-stefan.klug@ideasonboard.com> References: <20240628104828.2928109-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" There are valid cases where a module returns None. E.g no images were provided for lsc calibration. We should however define proper semantics there. Continue with a warning for now. Signed-off-by: Stefan Klug Reviewed-by: Laurent Pinchart --- utils/tuning/libtuning/generators/yaml_output.py | 3 +++ utils/tuning/libtuning/libtuning.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/tuning/libtuning/generators/yaml_output.py b/utils/tuning/libtuning/generators/yaml_output.py index 31e265df4ea7..c490081d7de7 100644 --- a/utils/tuning/libtuning/generators/yaml_output.py +++ b/utils/tuning/libtuning/generators/yaml_output.py @@ -107,6 +107,9 @@ class YamlOutput(Generator): ] for module in output_order: + if module not in output_dict: + continue + out_lines.append(f' - {module.out_name}:') if len(output_dict[module]) == 0: diff --git a/utils/tuning/libtuning/libtuning.py b/utils/tuning/libtuning/libtuning.py index 5342e5d6daaa..e7c63535fefd 100644 --- a/utils/tuning/libtuning/libtuning.py +++ b/utils/tuning/libtuning/libtuning.py @@ -200,8 +200,8 @@ class Tuner(object): for module in self.modules: out = module.process(self.config, images, self.output) if out is None: - logger.error(f'Module {module.hr_name} failed to process...') - break + logger.warning(f'Module {module.hr_name} failed to process...') + continue self.output[module] = out self.generator.write(args.output, self.output, self.output_order)