sda.dashboard.config ==================== .. py:module:: sda.dashboard.config .. autoapi-nested-parse:: Dashboard Configuration. ====================== Central configuration for the SDA Dashboard including: - Column name standardization - Default settings - UI styling constants - Spark brand colors and design system Attributes ---------- .. autoapisummary:: sda.dashboard.config.STANDARD_COLUMN_NAMES sda.dashboard.config.BLACKLIST_COLUMNS sda.dashboard.config.DEFAULT_TEST sda.dashboard.config.SPARK_COLORS sda.dashboard.config.COLORS sda.dashboard.config.GRAPH_CONFIG sda.dashboard.config.LAYOUT_CONFIG sda.dashboard.config.DASHBOARD_CONFIG sda.dashboard.config.CSS_CLASSES sda.dashboard.config.FILTER_COLUMNS sda.dashboard.config.DYNAMIC_FILTER_CONFIG sda.dashboard.config.DYNAMIC_FILTER_SLOTS Functions --------- .. autoapisummary:: sda.dashboard.config.get_resolved_theme sda.dashboard.config.clear_theme_cache sda.dashboard.config.force_theme sda.dashboard.config.debug_theme_detection sda.dashboard.config.get_filter_allocation Module Contents --------------- .. py:function:: get_resolved_theme() Get the resolved theme mode (light/dark/system), handling system theme detection. This function: 1. Reads the theme setting from config once 2. If "system", returns "system" to let client-side handle detection 3. If "light" or "dark", returns the explicit theme 4. Caches the result to avoid repeated lookups :returns: Either "light", "dark", or "system" :rtype: :py:class:`str` .. py:function:: clear_theme_cache() Clear the theme cache to force re-detection on next call. .. py:function:: force_theme(theme) Force set a specific theme, bypassing normal detection. This is useful for testing or when the automatic detection fails. :param theme: Either "light" or "dark" :type theme: :py:class:`str` .. py:function:: debug_theme_detection() Debug function to show current theme detection status. .. py:data:: STANDARD_COLUMN_NAMES :type: dict[str, list[str]] COLUMN NAME CONSISTENCY FIX: This dictionary has been temporarily disabled to fix the E2E test failures. The Column Name Consistency Requirement states that column names displayed in UI dropdowns MUST exactly match the column names in processed data. Previously, this mapping was transforming: - "Générateur" -> "générateur" (case change) - "Torche" -> "torche" (case change) - "Tension NRP (kV)" -> "tension (kV)" (case + name change) - "Débit gaz in (slm)" -> "débit (SL/m)" (case + format change) This caused the UI to display original names but the data pipeline to use transformed names, resulting in visualization callbacks receiving empty data. By disabling these transformations, we preserve the original column names throughout the entire data pipeline, ensuring UI and data consistency. TODO: Future enhancement - implement proper column name standardization that updates both the data processing AND the UI components to use the same standardized names. .. py:data:: BLACKLIST_COLUMNS :type: list[str] :value: [] This list defines columns that should be excluded from dashboard processing. Any column matching these names (case-sensitive) will be removed from the data before visualization and filtering. This allows for a more flexible approach where any column not blacklisted can be used for filtering and plotting. .. py:data:: DEFAULT_TEST :value: 'T183' .. py:data:: SPARK_COLORS :type: Dict[str, Any] .. py:data:: COLORS .. py:data:: GRAPH_CONFIG .. py:data:: LAYOUT_CONFIG .. py:data:: DASHBOARD_CONFIG .. py:data:: CSS_CLASSES .. py:data:: FILTER_COLUMNS :value: ['Générateur', 'Torche', 'Test', 'Fréquence (kHz)', 'Tension NRP (kV)', 'Débit gaz in (slm)',... This list defines which columns will be available as filter options in the dashboard's UI (e.g., in the Scatter and Line tabs). .. py:data:: DYNAMIC_FILTER_CONFIG .. py:data:: DYNAMIC_FILTER_SLOTS :value: 10 Number of dynamic filter slots available in the dashboard. These slots will be automatically allocated to the first N selected columns from the Test Selection tab. This approach provides: - Fixed callback structure (no performance issues) - Dynamic content (filters adapt to user selection) - User control (user decides which columns get filters) .. py:function:: get_filter_allocation(test_data, selected_columns, data_manager, verbose=False) Get the allocation of columns to filter slots. This function provides a centralized way to determine which columns get allocated to which filter slots. Both the dynamic filter callback and the plot callbacks use this to ensure consistency. :param test_data: Test name(s) :type test_data: :py:class:`str` or :py:class:`list` :param selected_columns: Selected columns from Test Selection tab :type selected_columns: :py:class:`list` or :py:obj:`None` :param data_manager: Data manager instance :type data_manager: :py:class:`DashboardDataManager` :param verbose: Whether to print debug information :type verbose: :py:class:`bool` :returns: List of column names allocated to filter slots (length = DYNAMIC_FILTER_SLOTS) :rtype: :py:class:`list`