<div dir="ltr">Hi<div><br></div><div>Thanks everyone for fixing up all this stuff. (If I'd known there was an official "pycodestyle" I'd have done it myself ages ago!).</div><div><br></div><div>I actually applied all 24 of these patches including this one, yesterday, and re-ran the tool to check that it still works. And it did, so I gave it the nod!</div><div><br></div><div>Regards</div><div><br></div><div>David</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 14 May 2020 at 10:08, Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com">kieran.bingham@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Laurent<br>
<br>
On 12/05/2020 17:38, Laurent Pinchart wrote:<br>
> Hi Kieran,<br>
> <br>
> On Tue, May 12, 2020 at 09:25:59AM +0100, Kieran Bingham wrote:<br>
>> On 12/05/2020 01:03, Laurent Pinchart wrote:<br>
>>> W605 invalid escape sequence '\.'<br>
>>><br>
>><br>
>> Would these be better interpreted as a 'raw' string?:<br>
>><br>
>>> - col = re.search('([0-9]+)[kK](\.(jpg|jpeg|brcm|dng)|_.*\.(jpg|jpeg|brcm|dng))$', string)<br>
>>> + col = re.search(r'([0-9]+)[kK](\.(jpg|jpeg|brcm|dng)|_.*\.(jpg|jpeg|brcm|dng))$', string)<br>
>><br>
>> That is how I have been handling regexes in python:<br>
>><br>
>> <a href="https://docs.python.org/3/howto/regex.html#the-backslash-plague" rel="noreferrer" target="_blank">https://docs.python.org/3/howto/regex.html#the-backslash-plague</a><br>
> <br>
> It's a good point. I'll submit a new version.<br>
> <br>
> Would you do the same for the strings in ctt_awb.py, or just for the<br>
> regexp ?<br>
<br>
the 'r' prefix is 'raw' not 'regexp', so I believe it applies to the<br>
ct_awb.py edits too.<br>
<br>
Might be worth testing the change somehow though to make sure it still<br>
works with the matplot component.<br>
<br>
I don't see a reason for it not to work ... but still.<br>
<br>
--<br>
Regards<br>
<br>
Kieran<br>
<br>
<br>
>>> Signed-off-by: Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com" target="_blank">laurent.pinchart@ideasonboard.com</a>><br>
>>> ---<br>
>>> utils/raspberrypi/ctt/ctt.py | 4 ++--<br>
>>> utils/raspberrypi/ctt/ctt_awb.py | 4 ++--<br>
>>> 2 files changed, 4 insertions(+), 4 deletions(-)<br>
>>><br>
>>> diff --git a/utils/raspberrypi/ctt/ctt.py b/utils/raspberrypi/ctt/ctt.py<br>
>>> index ff264176f040..4d8d6addf415 100755<br>
>>> --- a/utils/raspberrypi/ctt/ctt.py<br>
>>> +++ b/utils/raspberrypi/ctt/ctt.py<br>
>>> @@ -41,8 +41,8 @@ def get_col_lux(string):<br>
>>> """<br>
>>> Extract colour and lux values from filename<br>
>>> """<br>
>>> - col = re.search('([0-9]+)[kK](\.(jpg|jpeg|brcm|dng)|_.*\.(jpg|jpeg|brcm|dng))$', string)<br>
>>> - lux = re.search('([0-9]+)[lL](\.(jpg|jpeg|brcm|dng)|_.*\.(jpg|jpeg|brcm|dng))$', string)<br>
>>> + col = re.search('([0-9]+)[kK](\\.(jpg|jpeg|brcm|dng)|_.*\\.(jpg|jpeg|brcm|dng))$', string)<br>
>>> + lux = re.search('([0-9]+)[lL](\\.(jpg|jpeg|brcm|dng)|_.*\\.(jpg|jpeg|brcm|dng))$', string)<br>
>>> try:<br>
>>> col = col.group(1)<br>
>>> except AttributeError:<br>
>>> diff --git a/utils/raspberrypi/ctt/ctt_awb.py b/utils/raspberrypi/ctt/ctt_awb.py<br>
>>> index 58ef8432fb86..e97d833d0e49 100644<br>
>>> --- a/utils/raspberrypi/ctt/ctt_awb.py<br>
>>> +++ b/utils/raspberrypi/ctt/ctt_awb.py<br>
>>> @@ -256,8 +256,8 @@ def awb(Cam, cal_cr_list, cal_cb_list, plot):<br>
>>> plt.scatter(rbs_hat[0], rbs_hat[1], color='red')<br>
>>> for i, ct in enumerate(rbs_hat[2]):<br>
>>> plt.annotate(str(ct), (rbs_hat[0][i], rbs_hat[1][i]))<br>
>>> - plt.xlabel('$\hat{r}$')<br>
>>> - plt.ylabel('$\hat{b}$')<br>
>>> + plt.xlabel('$\\hat{r}$')<br>
>>> + plt.ylabel('$\\hat{b}$')<br>
>>> """<br>
>>> optional set axes equal to shortest distance so line really does<br>
>>> looks perpendicular and everybody is happy<br>
> <br>
<br>
-- <br>
Regards<br>
--<br>
Kieran<br>
_______________________________________________<br>
libcamera-devel mailing list<br>
<a href="mailto:libcamera-devel@lists.libcamera.org" target="_blank">libcamera-devel@lists.libcamera.org</a><br>
<a href="https://lists.libcamera.org/listinfo/libcamera-devel" rel="noreferrer" target="_blank">https://lists.libcamera.org/listinfo/libcamera-devel</a><br>
</blockquote></div>