From patchwork Wed Jul 3 14:17:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20532 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 52862BEFBE for ; Wed, 3 Jul 2024 14:18:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 01D1563372; Wed, 3 Jul 2024 16:18:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="EM/gHc98"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9EE986336E for ; Wed, 3 Jul 2024 16:18:26 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:9263:c199:9587:576]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7F4684CA; Wed, 3 Jul 2024 16:17:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1720016278; bh=K33EG7elE+JgYUBh7qjIArnf9ym+nG5nGPpBVymhUbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EM/gHc98/Zucg3wPhr09xjc5yUKKZ4mgxb2Tku1MGKMBG5ZQ7m2TcnJYCIpZ0Lxww e38huvzq+CbW0UG21DzuRllUzxrt2zgatoD1mtM8uomW45sA9anjIV8hL6Mq6AwdIr mW1DeWwOZOw3g8vTp8SCscBZeOwi8mvi6fRmFVLI= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Laurent Pinchart Subject: [PATCH v3 18/23] libtuning: Only warn if processing returns None Date: Wed, 3 Jul 2024 16:17:07 +0200 Message-ID: <20240703141726.252368-19-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240703141726.252368-1-stefan.klug@ideasonboard.com> References: <20240703141726.252368-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 Reviewed-by: Paul Elder --- 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)