sda.dashboard.data ================== .. py:module:: sda.dashboard.data .. autoapi-nested-parse:: Data Package. ============ Data loading and processing utilities for the dashboard. Submodules ---------- .. toctree:: :maxdepth: 1 /_api/sda/dashboard/data/loader/index Attributes ---------- .. autoapisummary:: sda.dashboard.data.data_manager Classes ------- .. autoapisummary:: sda.dashboard.data.DashboardDataManager Functions --------- .. autoapisummary:: sda.dashboard.data.get_data_manager Package Contents ---------------- .. py:class:: DashboardDataManager Manages data loading and caching for the dashboard. UNIFIED CACHING ARCHITECTURE: 1. Raw Data Loading: - Individual tests: load_test_data() uses @lru_cache - Multiple tests: load_multiple_tests() uses cached individual test data 2. UNIFIED Methods (handle both single tests and lists): - get_processed_data(test_input): Works with str or List[str] - get_column_names(test_input): Works with str or List[str] - get_filter_options(test_input): Works with str or List[str] - get_default_selections(test_input): Works with str or List[str] - get_all_available_columns(test_input): Works with str or List[str] - get_data_with_selected_columns(test_input, columns): Works with str or List[str] 3. Benefits: - All methods use cached processed data - No duplicate file loading during dashboard startup - Simplified API with fewer methods to maintain - Consistent behavior across single and multiple test scenarios .. py:attribute:: verbose :value: False .. py:attribute:: startup_test_name :value: None .. py:method:: set_verbose(verbose) Set verbose mode for all data operations. :param verbose: Whether to enable verbose output for data loading operations :type verbose: :py:class:`bool` .. py:method:: load_test_data(test_name) Load test data with caching. :param test_name: Name of the test to load :type test_name: :py:class:`str` :returns: Raw test data :rtype: :py:class:`pd.DataFrame` .. py:method:: load_multiple_tests(test_names) Load multiple tests and combine them using cached individual test data. :param test_names: List of test names to load :type test_names: :py:class:`List[str]` :returns: Combined test data :rtype: :py:class:`pd.DataFrame` .. py:method:: get_processed_data(test_input) Get processed and standardized data for one or multiple tests (UNIFIED METHOD). :param test_input: Single test name or list of test names to load :type test_input: :py:class:`str` or :py:class:`List[str]` :returns: Processed and standardized data :rtype: :py:class:`pd.DataFrame` .. py:method:: get_column_names(test_input) Get available column names for one or multiple tests (UNIFIED METHOD). :param test_input: Single test name or list of test names :type test_input: :py:class:`str` or :py:class:`List[str]` :returns: List of column names :rtype: :py:class:`List[str]` .. py:method:: get_filter_options(test_input) Get unique values for filters for one or multiple tests (UNIFIED METHOD). :param test_input: Single test name or list of test names :type test_input: :py:class:`str` or :py:class:`List[str]` :returns: Dictionary with filter options for each column :rtype: :py:class:`Dict[str`, :py:class:`List]` .. py:method:: get_default_selections(test_input) Get default selections for dropdowns for one or multiple tests (UNIFIED METHOD). :param test_input: Single test name or list of test names :type test_input: :py:class:`str` or :py:class:`List[str]` :returns: Dictionary with default selections :rtype: :py:class:`Dict[str`, :py:class:`Optional[str]]` .. py:method:: get_all_available_columns(test_input) Get all available column names for one or multiple tests using cached raw data (UNIFIED METHOD). :param test_input: Single test name or list of test names :type test_input: :py:class:`str` or :py:class:`List[str]` :returns: List of all column names available in the raw test data :rtype: :py:class:`List[str]` .. py:method:: get_data_with_selected_columns(test_input, selected_columns) Get data with only the selected columns for one or multiple tests (UNIFIED METHOD). :param test_input: Single test name or list of test names :type test_input: :py:class:`str` or :py:class:`List[str]` :param selected_columns: List of column names to include :type selected_columns: :py:class:`List[str]` :returns: Data with only the selected columns :rtype: :py:class:`pd.DataFrame` .. py:method:: get_excel_file_path(test_name) Get the Excel file path for a test (same logic as used during data loading). :param test_name: Name of the test :type test_name: :py:class:`str` :returns: Path to the Excel file, or empty string if not found :rtype: :py:class:`str` .. py:data:: data_manager .. py:function:: get_data_manager() Get the global data manager instance. :returns: Global data manager instance :rtype: :py:class:`DashboardDataManager`