sda.dashboard.config#

Dashboard Configuration.


Central configuration for the SDA Dashboard including: - Column name standardization - Default settings - UI styling constants - Spark brand colors and design system

Attributes#

STANDARD_COLUMN_NAMES

COLUMN NAME CONSISTENCY FIX:

BLACKLIST_COLUMNS

This list defines columns that should be excluded from dashboard processing.

DEFAULT_TEST

SPARK_COLORS

COLORS

GRAPH_CONFIG

LAYOUT_CONFIG

DASHBOARD_CONFIG

CSS_CLASSES

FILTER_COLUMNS

This list defines which columns will be available as filter options in the

DYNAMIC_FILTER_CONFIG

DYNAMIC_FILTER_SLOTS

Number of dynamic filter slots available in the dashboard.

Functions#

get_resolved_theme()

Get the resolved theme mode (light/dark/system), handling system theme detection.

clear_theme_cache()

Clear the theme cache to force re-detection on next call.

force_theme(theme)

Force set a specific theme, bypassing normal detection.

debug_theme_detection()

Debug function to show current theme detection status.

get_filter_allocation(test_data, selected_columns, ...)

Get the allocation of columns to filter slots.

Module Contents#

sda.dashboard.config.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”

Return type:

str

sda.dashboard.config.clear_theme_cache()#

Clear the theme cache to force re-detection on next call.

sda.dashboard.config.force_theme(theme)#

Force set a specific theme, bypassing normal detection.

This is useful for testing or when the automatic detection fails.

Parameters:

theme (str) – Either “light” or “dark”

sda.dashboard.config.debug_theme_detection()#

Debug function to show current theme detection status.

sda.dashboard.config.STANDARD_COLUMN_NAMES: 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.

sda.dashboard.config.BLACKLIST_COLUMNS: list[str] = []#

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.

sda.dashboard.config.DEFAULT_TEST = 'T183'#
sda.dashboard.config.SPARK_COLORS: Dict[str, Any]#
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 = ['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).

sda.dashboard.config.DYNAMIC_FILTER_CONFIG#
sda.dashboard.config.DYNAMIC_FILTER_SLOTS = 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)

sda.dashboard.config.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.

Parameters:
  • test_data (str or list) – Test name(s)

  • selected_columns (list or None) – Selected columns from Test Selection tab

  • data_manager (DashboardDataManager) – Data manager instance

  • verbose (bool) – Whether to print debug information

Returns:

List of column names allocated to filter slots (length = DYNAMIC_FILTER_SLOTS)

Return type:

list