Lazy Loading Configuration#

Configuration management for lazy loading functionality.

This module provides configuration management for the lazy loading system, allowing users to customize behavior and persist settings.

LazyLoadingConfig([folder_scan_batch_size, ...])

Configuration for lazy loading behavior.

ConfigManager(*args, **kwargs)

Manager for lazy loading configuration.

get_config()

Get the current lazy loading configuration.

update_config(**kwargs)

Update the lazy loading configuration.

class mdaviz.lazy_loading_config.ConfigManager(*args: Any, **kwargs: Any)[source]#

Manager for lazy loading configuration.

This class manages the loading, saving, and updating of lazy loading configuration settings.

_load_config() LazyLoadingConfig[source]#

Load configuration from file or create default.

config_changed#

alias of object

get_config() LazyLoadingConfig[source]#

Get the current configuration.

get_memory_usage_mb() float[source]#

Get current memory usage in megabytes.

Returns:

float: Memory usage in MB

is_memory_usage_high() bool[source]#

Check if memory usage is above the warning threshold.

Returns:

bool: True if memory usage is high

reset_to_defaults() bool[source]#

Reset configuration to default values.

Returns:

bool: True if successful, False otherwise

save_config(config: LazyLoadingConfig) bool[source]#

Save configuration to file.

Parameters:

config (LazyLoadingConfig): Configuration to save

Returns:

bool: True if successful, False otherwise

update_config(**kwargs) bool[source]#

Update configuration with new values.

Parameters:

**kwargs: Configuration values to update

Returns:

bool: True if successful, False otherwise

class mdaviz.lazy_loading_config.LazyLoadingConfig(folder_scan_batch_size: int = 50, folder_scan_max_files: int = 10000, folder_scan_use_lightweight: bool = True, data_cache_max_size_mb: float = 500.0, data_cache_max_entries: int = 100, data_cache_enable_compression: bool = False, virtual_table_page_size: int = 100, virtual_table_preload_pages: int = 2, enable_progress_dialogs: bool = True, enable_memory_monitoring: bool = True, memory_warning_threshold_mb: float = 1000.0, show_cache_stats: bool = False, auto_clear_cache_on_low_memory: bool = True)[source]#

Configuration for lazy loading behavior.

This class contains all the configuration options for the lazy loading system, including cache sizes, batch sizes, and performance settings.

classmethod from_dict(data: dict[str, Any]) LazyLoadingConfig[source]#

Create configuration from dictionary.

classmethod load_from_file(file_path: Path) LazyLoadingConfig | None[source]#

Load configuration from file.

Parameters:

file_path (Path): Path to load configuration from

Returns:

LazyLoadingConfig or None: Configuration if successful, None otherwise

save_to_file(file_path: Path) bool[source]#

Save configuration to file.

Parameters:

file_path (Path): Path to save configuration

Returns:

bool: True if successful, False otherwise

to_dict() dict[str, Any][source]#

Convert configuration to dictionary.

mdaviz.lazy_loading_config.get_config() LazyLoadingConfig[source]#

Get the current lazy loading configuration.

Returns:

LazyLoadingConfig: Current configuration

mdaviz.lazy_loading_config.get_global_config_manager() ConfigManager[source]#

Get the global configuration manager instance.

Returns:

ConfigManager: Global configuration manager

mdaviz.lazy_loading_config.update_config(**kwargs) bool[source]#

Update the lazy loading configuration.

Parameters:

**kwargs: Configuration values to update

Returns:

bool: True if successful, False otherwise