hbat.config.parameter_controller#

Parameter controller for HBAT analysis parameters.

This module provides a framework-agnostic controller for managing analysis parameters, independent of any UI framework.

Classes

ParameterController([params])

Manage analysis parameters independent of UI framework.

class hbat.config.parameter_controller.ParameterController(params: AnalysisParameters | None = None)[source]#

Manage analysis parameters independent of UI framework.

Provides get/set operations, validation, persistence, and parameter grouping by category.

__init__(params: AnalysisParameters | None = None)[source]#

Initialize parameter controller.

Parameters:

params – Initial AnalysisParameters instance. If None, creates default.

get_parameter(name: str) Any[source]#

Get a parameter value by name.

Parameters:

name – Parameter name (e.g., ‘hb_distance_cutoff’)

Returns:

Parameter value

Raises:

AttributeError – If parameter doesn’t exist

set_parameter(name: str, value: Any) None[source]#

Set a parameter value by name.

Parameters:
  • name – Parameter name

  • value – New parameter value

Raises:
validate_parameter(name: str, value: Any) bool[source]#

Validate a parameter value.

Parameters:
  • name – Parameter name

  • value – Value to validate

Returns:

True if valid, False otherwise

reset_to_defaults() None[source]#

Reset all parameters to their default values.

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

Convert parameters to dictionary.

Returns:

Dictionary mapping parameter names to values

from_dict(params_dict: Dict[str, Any]) None[source]#

Update parameters from dictionary.

Parameters:

params_dict – Dictionary mapping parameter names to values

Raises:

ValueError – If any value fails validation

get_parameters_by_category() Dict[str, Dict[str, ParameterConfig]][source]#

Get all parameters grouped by category.

Returns:

Dictionary mapping categories to parameter configs. Example structure:

{
    "Hydrogen Bonds": {
        "hb_distance_cutoff": ParameterConfig(...),
        ...
    },
    ...
}

get_parameters_list() List[ParameterConfig][source]#

Get all parameter configurations.

Returns:

List of ParameterConfig objects

get_category_parameters(category: str) Dict[str, ParameterConfig][source]#

Get all parameters for a specific category.

Parameters:

category – Category name

Returns:

Dictionary mapping parameter names to configs for the category