From 626172a16bba9a601c7652569ce9410631c1e6c0 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 8 May 2024 19:28:06 +0300 Subject: libcamera: Drop file name from header comment blocks Source files in libcamera start by a comment block header, which includes the file name and a one-line description of the file contents. While the latter is useful to get a quick overview of the file contents at a glance, the former is mostly a source of inconvenience. The name in the comments can easily get out of sync with the file name when files are renamed, and copy & paste during development have often lead to incorrect names being used to start with. Readers of the source code are expected to know which file they're looking it. Drop the file name from the header comment block. The change was generated with the following script: ---------------------------------------- dirs="include/libcamera src test utils" declare -rA patterns=( ['c']=' \* ' ['cpp']=' \* ' ['h']=' \* ' ['py']='# ' ['sh']='# ' ) for ext in ${!patterns[@]} ; do files=$(for dir in $dirs ; do find $dir -name "*.${ext}" ; done) pattern=${patterns[${ext}]} for file in $files ; do name=$(basename ${file}) sed -i "s/^\(${pattern}\)${name} - /\1/" "$file" done done ---------------------------------------- This misses several files that are out of sync with the comment block header. Those will be addressed separately and manually. Signed-off-by: Laurent Pinchart Reviewed-by: Daniel Scally --- utils/tuning/libtuning/average.py | 2 +- utils/tuning/libtuning/generators/generator.py | 2 +- utils/tuning/libtuning/generators/raspberrypi_output.py | 2 +- utils/tuning/libtuning/generators/yaml_output.py | 2 +- utils/tuning/libtuning/gradient.py | 2 +- utils/tuning/libtuning/image.py | 2 +- utils/tuning/libtuning/libtuning.py | 2 +- utils/tuning/libtuning/macbeth.py | 2 +- utils/tuning/libtuning/modules/lsc/raspberrypi.py | 2 +- utils/tuning/libtuning/modules/lsc/rkisp1.py | 2 +- utils/tuning/libtuning/modules/module.py | 2 +- utils/tuning/libtuning/parsers/parser.py | 2 +- utils/tuning/libtuning/parsers/raspberrypi_parser.py | 2 +- utils/tuning/libtuning/parsers/yaml_parser.py | 2 +- utils/tuning/libtuning/smoothing.py | 2 +- utils/tuning/libtuning/utils.py | 2 +- utils/tuning/raspberrypi/alsc.py | 2 +- utils/tuning/raspberrypi_alsc_only.py | 2 +- utils/tuning/rkisp1.py | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) (limited to 'utils/tuning') diff --git a/utils/tuning/libtuning/average.py b/utils/tuning/libtuning/average.py index e28770d7..c41075a1 100644 --- a/utils/tuning/libtuning/average.py +++ b/utils/tuning/libtuning/average.py @@ -2,7 +2,7 @@ # # Copyright (C) 2022, Paul Elder # -# average.py - Wrapper for numpy averaging functions to enable duck-typing +# Wrapper for numpy averaging functions to enable duck-typing import numpy as np diff --git a/utils/tuning/libtuning/generators/generator.py b/utils/tuning/libtuning/generators/generator.py index 7c8c9b99..77a8ba4a 100644 --- a/utils/tuning/libtuning/generators/generator.py +++ b/utils/tuning/libtuning/generators/generator.py @@ -2,7 +2,7 @@ # # Copyright (C) 2022, Paul Elder # -# generator.py - Base class for a generator to convert dict to tuning file +# Base class for a generator to convert dict to tuning file from pathlib import Path diff --git a/utils/tuning/libtuning/generators/raspberrypi_output.py b/utils/tuning/libtuning/generators/raspberrypi_output.py index 813491cd..47b49059 100644 --- a/utils/tuning/libtuning/generators/raspberrypi_output.py +++ b/utils/tuning/libtuning/generators/raspberrypi_output.py @@ -2,7 +2,7 @@ # # Copyright 2022 Raspberry Pi Ltd # -# raspberrypi_output.py - Generate tuning file in Raspberry Pi's json format +# Generate tuning file in Raspberry Pi's json format # # (Copied from ctt_pretty_print_json.py) diff --git a/utils/tuning/libtuning/generators/yaml_output.py b/utils/tuning/libtuning/generators/yaml_output.py index effb4fb3..8f22d386 100644 --- a/utils/tuning/libtuning/generators/yaml_output.py +++ b/utils/tuning/libtuning/generators/yaml_output.py @@ -2,7 +2,7 @@ # # Copyright 2022 Paul Elder # -# yaml_output.py - Generate tuning file in YAML format +# Generate tuning file in YAML format from .generator import Generator diff --git a/utils/tuning/libtuning/gradient.py b/utils/tuning/libtuning/gradient.py index 5106f821..b643f502 100644 --- a/utils/tuning/libtuning/gradient.py +++ b/utils/tuning/libtuning/gradient.py @@ -2,7 +2,7 @@ # # Copyright (C) 2022, Paul Elder # -# gradient.py - Gradients that can be used to distribute or map numbers +# Gradients that can be used to distribute or map numbers import libtuning as lt diff --git a/utils/tuning/libtuning/image.py b/utils/tuning/libtuning/image.py index aa9d20b5..e2181b11 100644 --- a/utils/tuning/libtuning/image.py +++ b/utils/tuning/libtuning/image.py @@ -2,7 +2,7 @@ # # Copyright (C) 2019, Raspberry Pi Ltd # -# image.py - Container for an image and associated metadata +# Container for an image and associated metadata import binascii import numpy as np diff --git a/utils/tuning/libtuning/libtuning.py b/utils/tuning/libtuning/libtuning.py index d84c148f..5e22288d 100644 --- a/utils/tuning/libtuning/libtuning.py +++ b/utils/tuning/libtuning/libtuning.py @@ -2,7 +2,7 @@ # # Copyright (C) 2022, Paul Elder # -# libtuning.py - An infrastructure for camera tuning tools +# An infrastructure for camera tuning tools import argparse diff --git a/utils/tuning/libtuning/macbeth.py b/utils/tuning/libtuning/macbeth.py index 5faddf66..e1182464 100644 --- a/utils/tuning/libtuning/macbeth.py +++ b/utils/tuning/libtuning/macbeth.py @@ -2,7 +2,7 @@ # # Copyright (C) 2019, Raspberry Pi Ltd # -# macbeth.py - Locate and extract Macbeth charts from images +# Locate and extract Macbeth charts from images # (Copied from: ctt_macbeth_locator.py) # \todo Add debugging diff --git a/utils/tuning/libtuning/modules/lsc/raspberrypi.py b/utils/tuning/libtuning/modules/lsc/raspberrypi.py index 58f5000d..f19c7163 100644 --- a/utils/tuning/libtuning/modules/lsc/raspberrypi.py +++ b/utils/tuning/libtuning/modules/lsc/raspberrypi.py @@ -3,7 +3,7 @@ # Copyright (C) 2019, Raspberry Pi Ltd # Copyright (C) 2022, Paul Elder # -# raspberrypi.py - ALSC module for tuning Raspberry Pi +# ALSC module for tuning Raspberry Pi from .lsc import LSC diff --git a/utils/tuning/libtuning/modules/lsc/rkisp1.py b/utils/tuning/libtuning/modules/lsc/rkisp1.py index 5701ae0a..20406e43 100644 --- a/utils/tuning/libtuning/modules/lsc/rkisp1.py +++ b/utils/tuning/libtuning/modules/lsc/rkisp1.py @@ -3,7 +3,7 @@ # Copyright (C) 2019, Raspberry Pi Ltd # Copyright (C) 2022, Paul Elder # -# rkisp1.py - LSC module for tuning rkisp1 +# LSC module for tuning rkisp1 from .lsc import LSC diff --git a/utils/tuning/libtuning/modules/module.py b/utils/tuning/libtuning/modules/module.py index 12e2fc7c..de624384 100644 --- a/utils/tuning/libtuning/modules/module.py +++ b/utils/tuning/libtuning/modules/module.py @@ -2,7 +2,7 @@ # # Copyright (C) 2022, Paul Elder # -# module.py - Base class for algorithm-specific tuning modules +# Base class for algorithm-specific tuning modules # @var type Type of the module. Defined in the base module. diff --git a/utils/tuning/libtuning/parsers/parser.py b/utils/tuning/libtuning/parsers/parser.py index a17d8d71..0c3944c7 100644 --- a/utils/tuning/libtuning/parsers/parser.py +++ b/utils/tuning/libtuning/parsers/parser.py @@ -2,7 +2,7 @@ # # Copyright (C) 2022, Paul Elder # -# parser.py - Base class for a parser for a specific format of config file +# Base class for a parser for a specific format of config file class Parser(object): def __init__(self): diff --git a/utils/tuning/libtuning/parsers/raspberrypi_parser.py b/utils/tuning/libtuning/parsers/raspberrypi_parser.py index d26586ba..f1da4592 100644 --- a/utils/tuning/libtuning/parsers/raspberrypi_parser.py +++ b/utils/tuning/libtuning/parsers/raspberrypi_parser.py @@ -2,7 +2,7 @@ # # Copyright (C) 2022, Paul Elder # -# raspberrypi_parser.py - Parser for Raspberry Pi config file format +# Parser for Raspberry Pi config file format from .parser import Parser diff --git a/utils/tuning/libtuning/parsers/yaml_parser.py b/utils/tuning/libtuning/parsers/yaml_parser.py index 5c1673a5..244db24d 100644 --- a/utils/tuning/libtuning/parsers/yaml_parser.py +++ b/utils/tuning/libtuning/parsers/yaml_parser.py @@ -2,7 +2,7 @@ # # Copyright (C) 2022, Paul Elder # -# yaml_parser.py - Parser for YAML format config file +# Parser for YAML format config file from .parser import Parser diff --git a/utils/tuning/libtuning/smoothing.py b/utils/tuning/libtuning/smoothing.py index b8a5a242..de4d920c 100644 --- a/utils/tuning/libtuning/smoothing.py +++ b/utils/tuning/libtuning/smoothing.py @@ -2,7 +2,7 @@ # # Copyright (C) 2022, Paul Elder # -# smoothing.py - Wrapper for cv2 smoothing functions to enable duck-typing +# Wrapper for cv2 smoothing functions to enable duck-typing import cv2 diff --git a/utils/tuning/libtuning/utils.py b/utils/tuning/libtuning/utils.py index b60f2c9b..1e8128ea 100644 --- a/utils/tuning/libtuning/utils.py +++ b/utils/tuning/libtuning/utils.py @@ -3,7 +3,7 @@ # Copyright (C) 2019, Raspberry Pi Ltd # Copyright (C) 2022, Paul Elder # -# utils.py - Utilities for libtuning +# Utilities for libtuning import decimal import math diff --git a/utils/tuning/raspberrypi/alsc.py b/utils/tuning/raspberrypi/alsc.py index 024eb5a3..ba8fc9e1 100644 --- a/utils/tuning/raspberrypi/alsc.py +++ b/utils/tuning/raspberrypi/alsc.py @@ -2,7 +2,7 @@ # # Copyright (C) 2022, Paul Elder # -# alsc.py - ALSC module instance for Raspberry Pi tuning scripts +# ALSC module instance for Raspberry Pi tuning scripts import libtuning as lt from libtuning.modules.lsc import ALSCRaspberryPi diff --git a/utils/tuning/raspberrypi_alsc_only.py b/utils/tuning/raspberrypi_alsc_only.py index af04e6a8..777d8007 100755 --- a/utils/tuning/raspberrypi_alsc_only.py +++ b/utils/tuning/raspberrypi_alsc_only.py @@ -3,7 +3,7 @@ # # Copyright (C) 2022, Paul Elder # -# raspberrypi_alsc_only.py - Tuning script for raspberrypi, ALSC only +# Tuning script for raspberrypi, ALSC only import sys diff --git a/utils/tuning/rkisp1.py b/utils/tuning/rkisp1.py index 1cea6ddb..517c791e 100755 --- a/utils/tuning/rkisp1.py +++ b/utils/tuning/rkisp1.py @@ -3,7 +3,7 @@ # # Copyright (C) 2022, Paul Elder # -# rkisp1.py - Tuning script for rkisp1 +# Tuning script for rkisp1 import sys -- cgit v1.2.1