diff mbox

[1/2] scripts/graph-build-time: clarify backend selection

Message ID 1413111142-17643-1-git-send-email-luca@lucaceresoli.net
State Accepted
Headers show

Commit Message

Luca Ceresoli Oct. 12, 2014, 10:52 a.m. UTC
This instruction in the middle of 'import' lines looks very strange.

Also, it was not obvious to me what the 'Agg' backend is.

Both things are actually correct, but it took a while to find out why.
So clarify with a comment to save someone else's time.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Sascha Arthur <sascha.arthur@gmail.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
 support/scripts/graph-build-time | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Yann E. MORIN Oct. 12, 2014, 10:57 a.m. UTC | #1
Luca, All,

On 2014-10-12 12:52 +0200, Luca Ceresoli spake thusly:
> This instruction in the middle of 'import' lines looks very strange.
> 
> Also, it was not obvious to me what the 'Agg' backend is.
> 
> Both things are actually correct, but it took a while to find out why.
> So clarify with a comment to save someone else's time.
> 
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> Cc: Sascha Arthur <sascha.arthur@gmail.com>
> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

Except for a little typo:

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

> ---
>  support/scripts/graph-build-time | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/support/scripts/graph-build-time b/support/scripts/graph-build-time
> index 4bb90c2..b2817bd 100755
> --- a/support/scripts/graph-build-time
> +++ b/support/scripts/graph-build-time
> @@ -52,7 +52,12 @@
>  import matplotlib as mpl
>  import numpy
>  
> +# Use the Agg backend (which produces a PNG output, see
> +# http://matplotlib.org/faq/usage_faq.html#what-is-a-backend),
> +# otherwise an incorrect backend is used on soe host machines).

s/soe/smoe/

Regards,
Yann E. MORIN.

> +# Note: matplotlib.use() must be called *before* matplotlib.pyplot.
>  mpl.use('Agg')
> +
>  import matplotlib.pyplot as plt
>  import matplotlib.font_manager as fm
>  import csv
> -- 
> 1.9.1
>
Thomas De Schampheleire Oct. 12, 2014, 11:58 a.m. UTC | #2
"Yann E. MORIN" <yann.morin.1998@free.fr> schreef:
>Luca, All,
>
>On 2014-10-12 12:52 +0200, Luca Ceresoli spake thusly:
>> This instruction in the middle of 'import' lines looks very strange.
>> 
>> Also, it was not obvious to me what the 'Agg' backend is.
>> 
>> Both things are actually correct, but it took a while to find out why.
>> So clarify with a comment to save someone else's time.
>> 
>> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
>> Cc: Sascha Arthur <sascha.arthur@gmail.com>
>> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
>> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
>
>Except for a little typo:
>
>Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
>> ---
>>  support/scripts/graph-build-time | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/support/scripts/graph-build-time b/support/scripts/graph-build-time
>> index 4bb90c2..b2817bd 100755
>> --- a/support/scripts/graph-build-time
>> +++ b/support/scripts/graph-build-time
>> @@ -52,7 +52,12 @@
>>  import matplotlib as mpl
>>  import numpy
>>  
>> +# Use the Agg backend (which produces a PNG output, see
>> +# http://matplotlib.org/faq/usage_faq.html#what-is-a-backend),
>> +# otherwise an incorrect backend is used on soe host machines).
>
>s/soe/smoe/

Are you sure? ;-)
Peter Korsgaard Oct. 12, 2014, 3:22 p.m. UTC | #3
>>>>> "Luca" == Luca Ceresoli <luca@lucaceresoli.net> writes:

 > This instruction in the middle of 'import' lines looks very strange.
 > Also, it was not obvious to me what the 'Agg' backend is.

 > Both things are actually correct, but it took a while to find out why.
 > So clarify with a comment to save someone else's time.

 > Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
 > Cc: Sascha Arthur <sascha.arthur@gmail.com>
 > Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 > Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>

Committed with the typo fixed, thanks.
diff mbox

Patch

diff --git a/support/scripts/graph-build-time b/support/scripts/graph-build-time
index 4bb90c2..b2817bd 100755
--- a/support/scripts/graph-build-time
+++ b/support/scripts/graph-build-time
@@ -52,7 +52,12 @@ 
 import matplotlib as mpl
 import numpy
 
+# Use the Agg backend (which produces a PNG output, see
+# http://matplotlib.org/faq/usage_faq.html#what-is-a-backend),
+# otherwise an incorrect backend is used on soe host machines).
+# Note: matplotlib.use() must be called *before* matplotlib.pyplot.
 mpl.use('Agg')
+
 import matplotlib.pyplot as plt
 import matplotlib.font_manager as fm
 import csv