[libcamera-devel,00/24] utils: raspberrypi: ctt: Comply with pycodestyle
mbox series

Message ID 20200512000322.11753-1-laurent.pinchart@ideasonboard.com
Headers show
Series
  • utils: raspberrypi: ctt: Comply with pycodestyle
Related show

Message

Laurent Pinchart May 12, 2020, 12:02 a.m. UTC
Hello,

This patch series fixes most of the coding style issues reported by
pycodestyle in the ctt tool. I've left out two remaining issues as they
could be more controversial:

- Spaces around operators (E226 and 227)
- Usage of docstrings for comments (flagged by E302)

I can easily fix them if desired.

Laurent Pinchart (24):
  utils: raspberrypi: ctt: Fix pycodestyle E231
  utils: raspberrypi: ctt: Fix pycodestyle E201 and E202
  utils: raspberrypi: ctt: Fix pycodestyle E203
  utils: raspberrypi: ctt: Fix pycodestyle E241
  utils: raspberrypi: ctt: Fix pycodestyle E211
  utils: raspberrypi: ctt: Fix pycodestyle E251
  utils: raspberrypi: ctt: Fix pycodestyle E128
  utils: raspberrypi: ctt: Fix pycodestyle E225
  utils: raspberrypi: ctt: Fix pycodestyle E228
  utils: raspberrypi: ctt: Fix pycodestyle E701
  utils: raspberrypi: ctt: Fix pycodestyle E303
  utils: raspberrypi: ctt: Fix pycodestyle E261 and E262
  utils: raspberrypi: ctt: Fix pycodestyle W605
  utils: raspberrypi: ctt: Fix pycodestyle E222
  utils: raspberrypi: ctt: Fix pycodestyle E711 and E712
  utils: raspberrypi: ctt: Fix pycodestyle E123 and E126
  utils: raspberrypi: ctt: Fix pycodestyle E116 and E117
  utils: raspberrypi: ctt: Fix pycodestyle E713
  utils: raspberrypi: ctt: Fix pycodestyle E721
  utils: raspberrypi: ctt: Fix pycodestyle E722
  utils: raspberrypi: ctt: Fix pycodestyle W504
  utils: raspberrypi: ctt: Fix pycodestyle E741
  utils: raspberrypi: ctt: Fix pycodestyle E305
  utils: raspberrypi: ctt: Fix pycodestyle E302

 utils/raspberrypi/ctt/ctt.py                  | 257 ++++++++--------
 utils/raspberrypi/ctt/ctt_alsc.py             | 146 ++++-----
 utils/raspberrypi/ctt/ctt_awb.py              | 140 ++++-----
 utils/raspberrypi/ctt/ctt_ccm.py              |  67 ++--
 utils/raspberrypi/ctt/ctt_geq.py              |  50 +--
 utils/raspberrypi/ctt/ctt_image_load.py       | 125 ++++----
 utils/raspberrypi/ctt/ctt_lux.py              |  19 +-
 utils/raspberrypi/ctt/ctt_macbeth_locator.py  | 288 +++++++++---------
 utils/raspberrypi/ctt/ctt_noise.py            |  30 +-
 .../raspberrypi/ctt/ctt_pretty_print_json.py  |   9 +-
 utils/raspberrypi/ctt/ctt_ransac.py           |  56 ++--
 utils/raspberrypi/ctt/ctt_tools.py            |  64 ++--
 12 files changed, 641 insertions(+), 610 deletions(-)

Comments

Kieran Bingham May 12, 2020, 8:35 a.m. UTC | #1
Hi Laurent,

On 12/05/2020 01:02, Laurent Pinchart wrote:
> Hello,
> 
> This patch series fixes most of the coding style issues reported by
> pycodestyle in the ctt tool. I've left out two remaining issues as they
> could be more controversial:
> 
> - Spaces around operators (E226 and 227)
> - Usage of docstrings for comments (flagged by E302)
> 
> I can easily fix them if desired.

For all the below (excepting the discussion point in 13/24):

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

But it would be good to get feedback from David/Naush here too of course.

--
Kieran



> Laurent Pinchart (24):
>   utils: raspberrypi: ctt: Fix pycodestyle E231
>   utils: raspberrypi: ctt: Fix pycodestyle E201 and E202
>   utils: raspberrypi: ctt: Fix pycodestyle E203
>   utils: raspberrypi: ctt: Fix pycodestyle E241
>   utils: raspberrypi: ctt: Fix pycodestyle E211
>   utils: raspberrypi: ctt: Fix pycodestyle E251
>   utils: raspberrypi: ctt: Fix pycodestyle E128
>   utils: raspberrypi: ctt: Fix pycodestyle E225
>   utils: raspberrypi: ctt: Fix pycodestyle E228
>   utils: raspberrypi: ctt: Fix pycodestyle E701
>   utils: raspberrypi: ctt: Fix pycodestyle E303
>   utils: raspberrypi: ctt: Fix pycodestyle E261 and E262
>   utils: raspberrypi: ctt: Fix pycodestyle W605
>   utils: raspberrypi: ctt: Fix pycodestyle E222
>   utils: raspberrypi: ctt: Fix pycodestyle E711 and E712
>   utils: raspberrypi: ctt: Fix pycodestyle E123 and E126
>   utils: raspberrypi: ctt: Fix pycodestyle E116 and E117
>   utils: raspberrypi: ctt: Fix pycodestyle E713
>   utils: raspberrypi: ctt: Fix pycodestyle E721
>   utils: raspberrypi: ctt: Fix pycodestyle E722
>   utils: raspberrypi: ctt: Fix pycodestyle W504
>   utils: raspberrypi: ctt: Fix pycodestyle E741
>   utils: raspberrypi: ctt: Fix pycodestyle E305
>   utils: raspberrypi: ctt: Fix pycodestyle E302
> 
>  utils/raspberrypi/ctt/ctt.py                  | 257 ++++++++--------
>  utils/raspberrypi/ctt/ctt_alsc.py             | 146 ++++-----
>  utils/raspberrypi/ctt/ctt_awb.py              | 140 ++++-----
>  utils/raspberrypi/ctt/ctt_ccm.py              |  67 ++--
>  utils/raspberrypi/ctt/ctt_geq.py              |  50 +--
>  utils/raspberrypi/ctt/ctt_image_load.py       | 125 ++++----
>  utils/raspberrypi/ctt/ctt_lux.py              |  19 +-
>  utils/raspberrypi/ctt/ctt_macbeth_locator.py  | 288 +++++++++---------
>  utils/raspberrypi/ctt/ctt_noise.py            |  30 +-
>  .../raspberrypi/ctt/ctt_pretty_print_json.py  |   9 +-
>  utils/raspberrypi/ctt/ctt_ransac.py           |  56 ++--
>  utils/raspberrypi/ctt/ctt_tools.py            |  64 ++--
>  12 files changed, 641 insertions(+), 610 deletions(-)
>
Laurent Pinchart May 12, 2020, 2:11 p.m. UTC | #2
Hi Kieran,

On Tue, May 12, 2020 at 09:35:05AM +0100, Kieran Bingham wrote:
> On 12/05/2020 01:02, Laurent Pinchart wrote:
> > Hello,
> > 
> > This patch series fixes most of the coding style issues reported by
> > pycodestyle in the ctt tool. I've left out two remaining issues as they
> > could be more controversial:
> > 
> > - Spaces around operators (E226 and 227)
> > - Usage of docstrings for comments (flagged by E302)
> > 
> > I can easily fix them if desired.
> 
> For all the below (excepting the discussion point in 13/24):
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> But it would be good to get feedback from David/Naush here too of course.

Absolutely. David, Naush, as this is code you authored, I don't want to
merge anything that you wouldn't be comfortable with. I think
pycodestyle overall does a fairly good job of recommending a bit more
blank space in the code, and improve consistency, which I think improves
readability. There are exceptions, for instance E226 and E227 listed
above may not look nice in the numpy array slices notation, which is why
I've left those out for now.

> > Laurent Pinchart (24):
> >   utils: raspberrypi: ctt: Fix pycodestyle E231
> >   utils: raspberrypi: ctt: Fix pycodestyle E201 and E202
> >   utils: raspberrypi: ctt: Fix pycodestyle E203
> >   utils: raspberrypi: ctt: Fix pycodestyle E241
> >   utils: raspberrypi: ctt: Fix pycodestyle E211
> >   utils: raspberrypi: ctt: Fix pycodestyle E251
> >   utils: raspberrypi: ctt: Fix pycodestyle E128
> >   utils: raspberrypi: ctt: Fix pycodestyle E225
> >   utils: raspberrypi: ctt: Fix pycodestyle E228
> >   utils: raspberrypi: ctt: Fix pycodestyle E701
> >   utils: raspberrypi: ctt: Fix pycodestyle E303
> >   utils: raspberrypi: ctt: Fix pycodestyle E261 and E262
> >   utils: raspberrypi: ctt: Fix pycodestyle W605
> >   utils: raspberrypi: ctt: Fix pycodestyle E222
> >   utils: raspberrypi: ctt: Fix pycodestyle E711 and E712
> >   utils: raspberrypi: ctt: Fix pycodestyle E123 and E126
> >   utils: raspberrypi: ctt: Fix pycodestyle E116 and E117
> >   utils: raspberrypi: ctt: Fix pycodestyle E713
> >   utils: raspberrypi: ctt: Fix pycodestyle E721
> >   utils: raspberrypi: ctt: Fix pycodestyle E722
> >   utils: raspberrypi: ctt: Fix pycodestyle W504
> >   utils: raspberrypi: ctt: Fix pycodestyle E741
> >   utils: raspberrypi: ctt: Fix pycodestyle E305
> >   utils: raspberrypi: ctt: Fix pycodestyle E302
> > 
> >  utils/raspberrypi/ctt/ctt.py                  | 257 ++++++++--------
> >  utils/raspberrypi/ctt/ctt_alsc.py             | 146 ++++-----
> >  utils/raspberrypi/ctt/ctt_awb.py              | 140 ++++-----
> >  utils/raspberrypi/ctt/ctt_ccm.py              |  67 ++--
> >  utils/raspberrypi/ctt/ctt_geq.py              |  50 +--
> >  utils/raspberrypi/ctt/ctt_image_load.py       | 125 ++++----
> >  utils/raspberrypi/ctt/ctt_lux.py              |  19 +-
> >  utils/raspberrypi/ctt/ctt_macbeth_locator.py  | 288 +++++++++---------
> >  utils/raspberrypi/ctt/ctt_noise.py            |  30 +-
> >  .../raspberrypi/ctt/ctt_pretty_print_json.py  |   9 +-
> >  utils/raspberrypi/ctt/ctt_ransac.py           |  56 ++--
> >  utils/raspberrypi/ctt/ctt_tools.py            |  64 ++--
> >  12 files changed, 641 insertions(+), 610 deletions(-)
David Plowman May 13, 2020, 11:18 a.m. UTC | #3
On Tue, 12 May 2020 at 01:03, Laurent Pinchart <
laurent.pinchart@ideasonboard.com> wrote:

> Hello,
>
> This patch series fixes most of the coding style issues reported by
> pycodestyle in the ctt tool. I've left out two remaining issues as they
> could be more controversial:
>
> - Spaces around operators (E226 and 227)
> - Usage of docstrings for comments (flagged by E302)
>
> I can easily fix them if desired.
>
> Laurent Pinchart (24):
>   utils: raspberrypi: ctt: Fix pycodestyle E231
>   utils: raspberrypi: ctt: Fix pycodestyle E201 and E202
>   utils: raspberrypi: ctt: Fix pycodestyle E203
>   utils: raspberrypi: ctt: Fix pycodestyle E241
>   utils: raspberrypi: ctt: Fix pycodestyle E211
>   utils: raspberrypi: ctt: Fix pycodestyle E251
>   utils: raspberrypi: ctt: Fix pycodestyle E128
>   utils: raspberrypi: ctt: Fix pycodestyle E225
>   utils: raspberrypi: ctt: Fix pycodestyle E228
>   utils: raspberrypi: ctt: Fix pycodestyle E701
>   utils: raspberrypi: ctt: Fix pycodestyle E303
>   utils: raspberrypi: ctt: Fix pycodestyle E261 and E262
>   utils: raspberrypi: ctt: Fix pycodestyle W605
>   utils: raspberrypi: ctt: Fix pycodestyle E222
>   utils: raspberrypi: ctt: Fix pycodestyle E711 and E712
>   utils: raspberrypi: ctt: Fix pycodestyle E123 and E126
>   utils: raspberrypi: ctt: Fix pycodestyle E116 and E117
>   utils: raspberrypi: ctt: Fix pycodestyle E713
>   utils: raspberrypi: ctt: Fix pycodestyle E721
>   utils: raspberrypi: ctt: Fix pycodestyle E722
>   utils: raspberrypi: ctt: Fix pycodestyle W504
>   utils: raspberrypi: ctt: Fix pycodestyle E741
>   utils: raspberrypi: ctt: Fix pycodestyle E305
>   utils: raspberrypi: ctt: Fix pycodestyle E302
>
>  utils/raspberrypi/ctt/ctt.py                  | 257 ++++++++--------
>  utils/raspberrypi/ctt/ctt_alsc.py             | 146 ++++-----
>  utils/raspberrypi/ctt/ctt_awb.py              | 140 ++++-----
>  utils/raspberrypi/ctt/ctt_ccm.py              |  67 ++--
>  utils/raspberrypi/ctt/ctt_geq.py              |  50 +--
>  utils/raspberrypi/ctt/ctt_image_load.py       | 125 ++++----
>  utils/raspberrypi/ctt/ctt_lux.py              |  19 +-
>  utils/raspberrypi/ctt/ctt_macbeth_locator.py  | 288 +++++++++---------
>  utils/raspberrypi/ctt/ctt_noise.py            |  30 +-
>  .../raspberrypi/ctt/ctt_pretty_print_json.py  |   9 +-
>  utils/raspberrypi/ctt/ctt_ransac.py           |  56 ++--
>  utils/raspberrypi/ctt/ctt_tools.py            |  64 ++--
>  12 files changed, 641 insertions(+), 610 deletions(-)
>
>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>

(Can I reply just to this message to cover all 24 individual patches?
Thanks...!)


> --
> Regards,
>
> Laurent Pinchart
>
>
Laurent Pinchart May 13, 2020, 2:04 p.m. UTC | #4
Hi David,

On Wed, May 13, 2020 at 12:18:55PM +0100, David Plowman wrote:
> On Tue, 12 May 2020 at 01:03, Laurent Pinchart wrote:
> > Hello,
> >
> > This patch series fixes most of the coding style issues reported by
> > pycodestyle in the ctt tool. I've left out two remaining issues as they
> > could be more controversial:
> >
> > - Spaces around operators (E226 and 227)
> > - Usage of docstrings for comments (flagged by E302)
> >
> > I can easily fix them if desired.
> >
> > Laurent Pinchart (24):
> >   utils: raspberrypi: ctt: Fix pycodestyle E231
> >   utils: raspberrypi: ctt: Fix pycodestyle E201 and E202
> >   utils: raspberrypi: ctt: Fix pycodestyle E203
> >   utils: raspberrypi: ctt: Fix pycodestyle E241
> >   utils: raspberrypi: ctt: Fix pycodestyle E211
> >   utils: raspberrypi: ctt: Fix pycodestyle E251
> >   utils: raspberrypi: ctt: Fix pycodestyle E128
> >   utils: raspberrypi: ctt: Fix pycodestyle E225
> >   utils: raspberrypi: ctt: Fix pycodestyle E228
> >   utils: raspberrypi: ctt: Fix pycodestyle E701
> >   utils: raspberrypi: ctt: Fix pycodestyle E303
> >   utils: raspberrypi: ctt: Fix pycodestyle E261 and E262
> >   utils: raspberrypi: ctt: Fix pycodestyle W605
> >   utils: raspberrypi: ctt: Fix pycodestyle E222
> >   utils: raspberrypi: ctt: Fix pycodestyle E711 and E712
> >   utils: raspberrypi: ctt: Fix pycodestyle E123 and E126
> >   utils: raspberrypi: ctt: Fix pycodestyle E116 and E117
> >   utils: raspberrypi: ctt: Fix pycodestyle E713
> >   utils: raspberrypi: ctt: Fix pycodestyle E721
> >   utils: raspberrypi: ctt: Fix pycodestyle E722
> >   utils: raspberrypi: ctt: Fix pycodestyle W504
> >   utils: raspberrypi: ctt: Fix pycodestyle E741
> >   utils: raspberrypi: ctt: Fix pycodestyle E305
> >   utils: raspberrypi: ctt: Fix pycodestyle E302
> >
> >  utils/raspberrypi/ctt/ctt.py                  | 257 ++++++++--------
> >  utils/raspberrypi/ctt/ctt_alsc.py             | 146 ++++-----
> >  utils/raspberrypi/ctt/ctt_awb.py              | 140 ++++-----
> >  utils/raspberrypi/ctt/ctt_ccm.py              |  67 ++--
> >  utils/raspberrypi/ctt/ctt_geq.py              |  50 +--
> >  utils/raspberrypi/ctt/ctt_image_load.py       | 125 ++++----
> >  utils/raspberrypi/ctt/ctt_lux.py              |  19 +-
> >  utils/raspberrypi/ctt/ctt_macbeth_locator.py  | 288 +++++++++---------
> >  utils/raspberrypi/ctt/ctt_noise.py            |  30 +-
> >  .../raspberrypi/ctt/ctt_pretty_print_json.py  |   9 +-
> >  utils/raspberrypi/ctt/ctt_ransac.py           |  56 ++--
> >  utils/raspberrypi/ctt/ctt_tools.py            |  64 ++--
> >  12 files changed, 641 insertions(+), 610 deletions(-)
>
> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
> 
> (Can I reply just to this message to cover all 24 individual patches?
> Thanks...!)

Absolutely :-)

I've pushed all patches except for the one fixing W605, as I still need
to address a comment from Kieran.