summaryrefslogtreecommitdiff
path: root/utils/raspberrypi/ctt/ctt_tools.py
AgeCommit message (Collapse)Author
2024-05-08libcamera: Drop file name from header comment blocksLaurent Pinchart
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
2022-07-27raspberrypi: Update Copyright statement in all Raspberry Pi source filesNaushir Patuck
s/Raspberry Pi (Trading) Limited/Raspberry Pi Ltd/ to reflect the new Raspberry Pi entity name. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-08-03utils: raspberrypi: ctt: Fix namespace for sklearn NearestCentroid functionDavid Plowman
Starting in version 0.22, the NearestCentroid function is only available in the sklearn.neighbors namespace, when it was previously available in both the sklearn.neighbors.nearest_centroid and sklearn.neighbors namespaces. Use sklearn.neighbors as it works on all versions of sklearn. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E302Laurent Pinchart
E302 expected 2 blank lines, found 0 Note that issues are still flagged, due to the use of docstrings as multi-lines comments. This will be addressed separately. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E305Laurent Pinchart
E305 expected 2 blank lines after class or function definition Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E721Laurent Pinchart
E721 do not compare types, use 'isinstance()' Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E116 and E117Laurent Pinchart
E116 unexpected indentation (comment) E117 over-indented (comment) Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E711 and E712Laurent Pinchart
E711 comparison to None should be 'if cond is None:' E711 comparison to None should be 'if cond is not None:' E712 comparison to False should be 'if cond is False:' or 'if not cond:' E712 comparison to True should be 'if cond is True:' or 'if cond:' Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E228Laurent Pinchart
E228 missing whitespace around modulo operator Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E211Laurent Pinchart
E211 whitespace before '[' Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E231Laurent Pinchart
E231 missing whitespace after ',' E231 missing whitespace after ':' Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-11libcamera: utils: Raspberry Pi Camera Tuning ToolNaushir Patuck
Initial implementation of the Raspberry Pi (BCM2835) Camera Tuning Tool. All code is licensed under the BSD-2-Clause terms. Copyright (c) 2019-2020 Raspberry Pi Trading Ltd. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>