From 5a1aa1ab9c3f83f78ccc6e857d9b1561b2a63096 Mon Sep 17 00:00:00 2001
From: Christoph Alt <christoph.alt@fau.de>
Date: Wed, 11 Sep 2024 16:49:27 +0200
Subject: [PATCH] importing the is_regex function from panels.py

---
 dashboards/dashboard_fe2ti.py      | 5 +----
 dashboards/dashboard_pystencils.py | 5 +----
 dashboards/dashboard_walberla.py   | 8 ++------
 3 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/dashboards/dashboard_fe2ti.py b/dashboards/dashboard_fe2ti.py
index 2cdafae..7431f35 100644
--- a/dashboards/dashboard_fe2ti.py
+++ b/dashboards/dashboard_fe2ti.py
@@ -6,7 +6,7 @@ from dashboards.dashboard_base import (DashboardOptions,
 
 from dashboards.overrides import get_line_style_regex_override, get_color_regex_override
 
-from dashboards.panels import PanelInfos, get_time_series_panel, get_text_panel
+from dashboards.panels import PanelInfos, get_time_series_panel, get_text_panel, is_regex
 from dashboards.variables import get_dashboard_variable, Filter
 
 from dashboards.influx_queries import join_variable_and
@@ -41,9 +41,6 @@ INTEL_LINESTYLE = "solid"
 GCC_LINESTYLE = "dashed"
 
 
-def is_regex(name):
-    return name[0] == "/" and name[-1] == "/"
-
 def dashboard_fe2ti():
     data_source = "fe2ti"
     measurment_name = "fe2ti"
diff --git a/dashboards/dashboard_pystencils.py b/dashboards/dashboard_pystencils.py
index c299030..45986fc 100644
--- a/dashboards/dashboard_pystencils.py
+++ b/dashboards/dashboard_pystencils.py
@@ -5,7 +5,7 @@ from dashboards.dashboard_base import (DashboardOptions,
                                        Repeat,)
 
 
-from dashboards.panels import PanelInfos, get_time_series_panel
+from dashboards.panels import PanelInfos, get_time_series_panel, is_regex
 from dashboards.variables import get_dashboard_variable, Filter, get_measurement_filter
 
 from dashboards.influx_queries import join_variable_and
@@ -20,9 +20,6 @@ INTEL_LINESTYLE = "solid"
 GCC_LINESTYLE = "dashed"
 
 
-def is_regex(name):
-    return name[0] == "/" and name[-1] == "/"
-
 def dashboard_pystencils_cpu():
     data_source = "pystencils"
     row_repeat = "host"
diff --git a/dashboards/dashboard_walberla.py b/dashboards/dashboard_walberla.py
index 6feb703..e6cfff6 100644
--- a/dashboards/dashboard_walberla.py
+++ b/dashboards/dashboard_walberla.py
@@ -21,7 +21,7 @@ from dashboards.dashboard_base import (
 from dashboards.influx_queries import join_variable_and, get_variable_condition_with_tag, get_variable_tag, join_conditions, get_variable_condition, get_variable_condition_without_regex, get_variable_condition_unbounded
 from dashboards.legends import Units, AxisLabel
 from dashboards.overrides import get_color_regex_override, get_line_style_regex_override
-from dashboards.panels import PanelInfos, get_time_series_panel, get_table_panel, get_bar_chart_panel, get_pie_chart_panel
+from dashboards.panels import PanelInfos, get_time_series_panel, get_table_panel, get_bar_chart_panel, get_pie_chart_panel, is_regex
 from dashboards.variables import (
     Filter,
     get_dashboard_variable,
@@ -31,10 +31,6 @@ from dashboards.variables import (
 from dashboards.influx_queries import Query
 
 
-def is_regex(name):
-    return name[0] == "/" and name[-1] == "/"
-
-
 def dashboard_uniformgridcpu():
     data_source = "InfluxDB-1"
     arch = "CPU"
@@ -918,4 +914,4 @@ def dashboard_percolationgpu():
 
     return build_dashboard(
         options, rows=rows, templating=filter_vars, annotations=annotations
-    )
\ No newline at end of file
+    )
-- 
GitLab