hbat.config.ui_config#
Centralized configuration for HBAT UI, export, and parameter management.
This module defines the single source of truth for: - Interaction type columns and display properties - Parameter definitions and validation ranges - Data extraction patterns for all interaction types
This eliminates duplication across GUI, Server, and Export modules.
Functions
|
Extract formatted data from an interaction using config. |
|
Get configuration for a specific interaction type. |
|
Get configuration for a specific parameter. |
Group parameters by their category. |
Classes
|
Configuration for a single column in results display/export. |
|
Configuration for a single interaction type. |
|
Configuration for a single analysis parameter. |
- class hbat.config.ui_config.ColumnConfig(name: str, label: str, csv_header: str = '', json_key: str = '', width: int = 100, precision: int | None = None, accessor: Callable[[Any], Any] | None = None)[source]#
Configuration for a single column in results display/export.
Defines how a field should be displayed, exported, and formatted across all interfaces (GUI, Server, Export).
- class hbat.config.ui_config.InteractionConfig(id: str, label: str, icon: str = 'link', analyzer_attr: str = '', filename: str = '', columns: List[ColumnConfig] = <factory>, summary_keys: List[str] = <factory>)[source]#
Configuration for a single interaction type.
Defines all metadata needed to display, export, and format a specific type of molecular interaction.
- columns: List[ColumnConfig]#
- class hbat.config.ui_config.ParameterConfig(name: str, label: str, default: float | bool | str, min_val: float | int | None = None, max_val: float | int | None = None, category: str = 'General', description: str = '', param_type: str = 'float')[source]#
Configuration for a single analysis parameter.
Defines ranges, defaults, and metadata for parameters in the AnalysisParameters class.
- hbat.config.ui_config.get_interaction_config(interaction_type: str) InteractionConfig | None[source]#
Get configuration for a specific interaction type.
- Parameters:
interaction_type – Interaction type ID (e.g., “hydrogen_bonds”)
- Returns:
InteractionConfig or None if not found
- hbat.config.ui_config.get_parameter_config(param_name: str) ParameterConfig | None[source]#
Get configuration for a specific parameter.
- Parameters:
param_name – Parameter name
- Returns:
ParameterConfig or None if not found
- hbat.config.ui_config.extract_interaction_data(interaction: Any, config: InteractionConfig, interaction_index: int = 0) Dict[str, Any][source]#
Extract formatted data from an interaction using config.
Extracts all column values from an interaction object using the accessor functions defined in the config.
- Parameters:
interaction – MolecularInteraction object
config – InteractionConfig for this interaction type
interaction_index – Index for interactions without unique IDs
- Returns:
Dictionary mapping column names to formatted values