diff options
author | Tibor Frank <tifrank@cisco.com> | 2022-07-20 15:51:21 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2022-07-21 07:45:39 +0000 |
commit | ae1fe880286d7b0414664bce2b2c7c91c3f543f3 (patch) | |
tree | 5790af6de3884e0aa6918d44f23aca59cf0d86a7 /resources/tools/dash/app/pal/news/layout.py | |
parent | 739e01de7a65045dc42e6c16406a6d054da72f7b (diff) |
UTI: Move constatns to a separate file
Change-Id: If3796b71d02bcf5a92612585dfa8867e5039f037
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/dash/app/pal/news/layout.py')
-rw-r--r-- | resources/tools/dash/app/pal/news/layout.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/resources/tools/dash/app/pal/news/layout.py b/resources/tools/dash/app/pal/news/layout.py index 2f66ce5c81..c9f2808a14 100644 --- a/resources/tools/dash/app/pal/news/layout.py +++ b/resources/tools/dash/app/pal/news/layout.py @@ -27,7 +27,9 @@ from yaml import load, FullLoader, YAMLError from copy import deepcopy from ..data.data import Data -from ..data.utils import classify_anomalies +from ..utils.constants import Constants as C +from ..utils.utils import classify_anomalies +from ..data.data import Data from .tables import table_news @@ -35,12 +37,6 @@ class Layout: """The layout of the dash app and the callbacks. """ - # The default job displayed when the page is loaded first time. - DEFAULT_JOB = "csit-vpp-perf-mrr-daily-master-2n-icx" - - # Time period for regressions and progressions. - TIME_PERIOD = 21 # [days] - def __init__(self, app: Flask, html_layout_file: str, data_spec_file: str, tooltip_file: str) -> None: """Initialization: @@ -73,7 +69,7 @@ class Layout: data_stats, data_mrr, data_ndrpdr = Data( data_spec_file=self._data_spec_file, debug=True - ).read_stats(days=self.TIME_PERIOD) + ).read_stats(days=C.NEWS_TIME_PERIOD) df_tst_info = pd.concat([data_mrr, data_ndrpdr], ignore_index=True) @@ -95,7 +91,7 @@ class Layout: job_info["tbed"].append("-".join(lst_job[-2:])) self.df_job_info = pd.DataFrame.from_dict(job_info) - self._default = self._set_job_params(self.DEFAULT_JOB) + self._default = self._set_job_params(C.NEWS_DEFAULT_JOB) # Pre-process the data: |