Reduce "colour" import time by almost 1.5secs.
@@ -162,15 +162,8 @@ Report header content, i.e. the report title.
REPORT_HEADER_CONTENT : unicode
"""
-try:
- _COLOUR_VERSION = ' {0}.'.format(
- describe_environment(
- print_callable=lambda x: x)['colour-science.org']['colour'])
-except Exception: # noqa
- _COLOUR_VERSION = '.'
-
REPORT_FOOTER_CONTENT = ('Colours are for visual orientation purposes only. '
- 'Created with Colour{0}').format(_COLOUR_VERSION)
+ 'Created with Colour{0}')
"""
Report footer content.
@@ -223,11 +216,18 @@ def _plot_report_footer(axes):
Axes the report footer was added to.
"""
+ try:
+ version = ' {0}.'.format(
+ describe_environment(
+ print_callable=lambda x: x)['colour-science.org']['colour'])
+ except Exception: # noqa
+ version = '.'
+
axes.set_axis_off()
axes.text(
0.5,
0.5,
- REPORT_FOOTER_CONTENT,
+ REPORT_FOOTER_CONTENT.format(version),
ha='center',
va='center',
size='small')
