aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation/generator_CPTA.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2018-03-23 09:32:01 +0100
committerTibor Frank <tifrank@cisco.com>2018-03-23 10:06:34 +0100
commita09211590e3de1cb45c1ad1e0aae6fd84bf15c14 (patch)
tree71072f071d88b5e92bd283926165311b165d0bbf /resources/tools/presentation/generator_CPTA.py
parent87cfc7560cc1f78a70140112a298297e2c5496b6 (diff)
CSIT-949: Data models
Change-Id: I07d0b122632c15fa07a5871dc268d654f410ef4f Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/generator_CPTA.py')
-rw-r--r--resources/tools/presentation/generator_CPTA.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/resources/tools/presentation/generator_CPTA.py b/resources/tools/presentation/generator_CPTA.py
index c1b14f1f55..09d2e444ae 100644
--- a/resources/tools/presentation/generator_CPTA.py
+++ b/resources/tools/presentation/generator_CPTA.py
@@ -18,6 +18,7 @@ import datetime
import logging
import plotly.offline as ploff
import plotly.graph_objs as plgo
+import plotly.exceptions as plerr
import numpy as np
import pandas as pd
@@ -29,6 +30,7 @@ from utils import find_outliers, archive_input_data, execute_command
HTML_BUILDER = 'sphinx-build -v -c conf_cpta -a ' \
'-b html -E ' \
'-t html ' \
+ '-D version="Generated on {date}" ' \
'{working_dir} ' \
'{build_dir}/'
@@ -341,7 +343,10 @@ def _generate_chart(traces, layout, file_name):
# Create plot
logging.info(" Writing the file '{0}' ...".format(file_name))
plpl = plgo.Figure(data=traces, layout=layout)
- ploff.plot(plpl, show_link=False, auto_open=False, filename=file_name)
+ try:
+ ploff.plot(plpl, show_link=False, auto_open=False, filename=file_name)
+ except plerr.PlotlyEmptyDataError:
+ logging.warning(" No data for the plot. Skipped.")
def _generate_all_charts(spec, input_data):