Driver Layer¶
The driver layer is the central nervous system of REvoDesign — a bidirectional bridge between Qt UI widgets and OmegaConf/Hydra YAML configuration files. It manages singleton lifecycle, widget-to-config mapping, file dialogs, group registries, environment variables, and parameter toggle connections.
Core Classes¶
Config¶
@dataclass
class Config:
name: str
path: str
cfg: DictConfig
REvoDesign.driver.ui_driver.Config
dataclass
¶
A dataclass to represent a configuration file. It contains the name, path, and configuration data of a configuration file.
Attributes: name: str -- The name of the configuration file. path: str -- The path to the configuration file. cfg: DictConfig -- The configuration data of the configuration file.
from_name(name: str) -> Config A class method to create a Config object from a configuration name. from_names(names: list[str]) -> dict[str, Config] A class method to create a dictionary of Config objects from a list of configuration names. from_file(path: str) -> Config A class method to create a Config object from a configuration file path. from_files(paths: list[str]) -> dict[str, Config] A class method to create a dictionary of Config objects from a list of configuration file paths. save() Saves the configuration data to the configuration file. reload() Reloads the configuration data from the configuration file. save_as(file_path: str) Saves the configuration data to a specified file path.
from_name(name)
classmethod
¶
Create a Config object from a configuration name. Args: name (str): The name of the configuration file. Returns: Config: A Config object created from the configuration file. Raises: issues.ConfigureError: If the configuration file does not exist. issues.FileFormatError: If the configuration file is not a valid YAML file.
from_names(names)
classmethod
¶
Create a dictionary of Config objects from a list of configuration names. Args: names (list[str]): A list of configuration file names. Returns: dict[str, Config]: A dictionary of Config objects created from the configuration files.
Raises:
| Type | Description |
|---|---|
ConfigureError
|
If any of the configuration files do not exist. |
FileFormatError
|
If any of the configuration files are not valid YAML files. |
from_file(path)
classmethod
¶
Create a Config object from a configuration file path. Args: path (str): The path to the configuration file. Returns: Config: A Config object created from the configuration file.
Raises:
| Type | Description |
|---|---|
ConfigureError
|
If the configuration file does not exist. |
FileFormatError
|
If the configuration file is not a valid YAML file. |
from_files(paths)
classmethod
¶
Create a dictionary of Config objects from a list of configuration file paths. Args: paths (list[str]): A list of paths to configuration files. Returns: dict[str, Config]: A dictionary of Config objects created from the configuration files.
Raises:
| Type | Description |
|---|---|
ConfigureError
|
If any of the configuration files do not exist. |
FileFormatError
|
If any of the configuration files are not valid YAML files. |
save()
¶
Saves the configuration data to the configuration file.
save_to_experiment(experiment)
¶
located at REVODESIGN_CONFIG_DIR
experiment
- experiment: experiment/
.yaml - cache: cache/
.yaml
return: - path to the saved experiment file
reload()
¶
Reloads the configuration data from the configuration file.
reload_from_experiment(experiment)
¶
experiment
- experiment: experiment/
.yaml - cache: cache/
.yaml
reload_from_path(path)
¶
Reloads the configuration data from a specified file path. Args: path (str): The path to the configuration file. Raises: issues.ConfigureError: If the configuration file does not exist. issues.FileFormatError: If the configuration file is not a valid YAML file.
save_as(file_path)
¶
Saves the configuration data to a specified file path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The path to save the configuration file. |
required |
ConfigBus (detailed methods)¶
ConfigBus is the main singleton that orchestrates the UI-config bridge. It extends SingletonAbstract and CitableModuleAbstract. See the Core API overview for a higher-level introduction.
REvoDesign.driver.ui_driver.ConfigBus
¶
Bases: SingletonAbstract, CitableModuleAbstract
This class is responsible for handling the configuration and interaction between the UI widgets and the application's configuration settings.
Attributes:
| Name | Type | Description |
|---|---|---|
headless |
bool
|
Indicates whether the application is running in headless mode. |
ui |
QWidget
|
The main UI widget of the application. |
cfg |
OmegaConf
|
The application's configuration settings. |
w2c |
Widget2ConfigMapper
|
A mapper object that maps UI widgets to configuration settings. |
push_buttons |
dict
|
A dictionary of UI buttons. |
Methods:
| Name | Description |
|---|---|
Non-headless Methods |
initialize_widget_with_cfg_group(): Initializes UI widgets with their corresponding configuration settings. update_cfg_item_from_widget(widget_id: str): Updates a configuration setting based on the value of a UI widget. register_widget_changes_to_cfg(): Registers UI widget changes to update the configuration settings. get_widget_from_id(widget_id: str): Retrieves a UI widget based on its ID. get_widget_from_cfg_item(cfg_item: str): Retrieves a UI widget based on its corresponding configuration item. get_widget_value(cfg_item: str): Retrieves the value of a UI widget based on its corresponding configuration item. set_widget_value(cfg_item: str, value): Sets the value of a UI widget based on its corresponding configuration item. restore_widget_value(cfg_item: str): Restores the value of a UI widget to its default configuration setting. get_cfg_item(widget_id: str): Retrieves the configuration item corresponding to a UI widget ID. button(id: str): Retrieves a button widget based on its ID. toggle_buttons(buttons: Iterable, set_enabled: bool = False): Toggles the enabled state of a list of buttons. |
Headless Only Methods |
get_value(cfg_item: str, typing=None): Retrieves the value of a configuration item, with optional type casting. set_value(cfg_item: str, value): Sets the value of a configuration item. |
fp_lock |
Union[list, tuple, str], buttons_id_to_release: Union[list, tuple, str]): Locks or unlocks buttons based on the existence of file paths in the configuration. |
singleton_init(ui=None)
¶
initialize_widget_with_group()
¶
register_widget_changes_to_cfg()
¶
update_cfg_item_from_widget(widget_id)
¶
get_widget_from_id(widget_id)
¶
get_widget_from_cfg_item(cfg_item)
¶
get_widget_value(cfg_item, converter)
¶
set_widget_value(cfg_item, value, hard=False)
¶
restore_widget_value(cfg_item)
¶
get_cfg_item(widget_id)
¶
get_value(cfg_item, converter=None, reject_none=False, default_value=None, cfg='main')
¶
get_value(cfg_item: str, converter: Callable[[Any], ValueFromConfigT], reject_none: bool, default_value: None = ..., cfg: Config | str = 'main') -> ValueFromConfigT
get_value(cfg_item: str, converter: type[bool], reject_none: bool, default_value: bool = ..., cfg: Config | str = 'main') -> bool
get_value(cfg_item: str, converter: Callable[[Any], ValueFromConfigT], reject_none: bool = True, default_value: ValueFromConfigT | None = ..., cfg: Config | str = 'main') -> ValueFromConfigT
get_value(cfg_item: str, converter: None) -> Any
Retrieves the value of a configuration item with optional type casting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg_item
|
str
|
Name of the configuration item. |
required |
converter
|
Callable[[Any], ValueFromConfigT] | None
|
Callable to convert the value from the configuration item to a desired type. |
None
|
reject_none
|
bool
|
If True, raises an exception if the value is None. |
False
|
default_value
|
ValueFromConfigT | None
|
Default value to return if the value is None. |
None
|
Returns:
| Type | Description |
|---|---|
ValueFromConfigT | None
|
The converted value, the default value if provided, or None if allowed. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
set_value(cfg_item, value, cfg='main', force_add=False)
¶
toggle_buttons(button_ids, set_enabled=False)
¶
fp_lock(cfg_fps, buttons_id_to_release)
¶
button(button_id)
¶
Retrieves a button widget based on its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
button_id
|
str
|
Button ID. |
required |
Returns:
| Type | Description |
|---|---|
QPushButton
|
QtWidgets.QPushButton: Button object |
buttons(button_ids)
¶
Retrieves all button widgets based on its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
button_ids
|
tuple[str]
|
Button IDs. |
required |
Returns:
| Type | Description |
|---|---|
tuple[QPushButton, ...]
|
tuple[QtWidgets.QPushButton]: Button objects in the same order as the given IDs. |
Widget2ConfigMapper¶
Maps UI widgets to configuration items and provides lookup methods across both directions.
REvoDesign.driver.ui_driver.Widget2ConfigMapper
¶
This class maps UI widgets to configuration settings and provides methods to interact with these mappings.
Attributes:
| Name | Type | Description |
|---|---|---|
ui |
QWidget
|
The main UI widget of the application. |
run_button_ids |
tuple[str]
|
A tuple of IDs for buttons that trigger actions. |
push_buttons |
immutabledict
|
A mapping of button IDs to button widgets. |
c2wi |
Config2WidgetIds
|
An instance of the Config2WidgetIds class. |
config_widget_id_map |
immutabledict
|
A mapping of configuration items to widget IDs. |
config2widget_map |
immutabledict
|
A mapping of configuration items to widget widgets. |
widget_id2widget_map |
immutabledict
|
A mapping of widget IDs to widget widgets. |
Methods:
| Name | Description |
|---|---|
get_button_from_id |
Retrieves a button widget based on its ID. |
get_widget_from_id |
Retrieves a widget based on its ID. |
_find_config_item |
Finds the configuration item corresponding to a widget ID. |
_find_widget_id |
Finds the widget ID corresponding to a configuration item. |
all_widget_ids
property
¶
all_cfg_items
property
¶
widget_id2config_dict
property
¶
__init__(ui)
¶
find_child(widget_type, name)
¶
Find a child widget in a UI object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
widget_type
|
The type of the widget (e.g., QtWidgets.QLabel). |
required | |
name
|
The name of the widget. |
required |
Returns:
| Type | Description |
|---|---|
|
The found widget, or None if not found. |
get_button_from_id(button_id, prefix='pushButton', button_type=QtWidgets.QPushButton)
¶
find_config_item(widget_id)
¶
get_widget_from_id(widget_id)
¶
StoresWidget¶
A singleton that holds server-switch references (MenuActionServerMonitor instances) used across the application. Provides a reset_instance classmethod.
REvoDesign.driver.ui_driver.StoresWidget
¶
Bases: SingletonAbstract
reset_instance()
classmethod
¶
Reset the instance of the class and clear all server switches dictionaries.
HeadlessProtocol¶
A typing.Protocol that defines objects capable of running in headless mode, requiring a headless: bool attribute.
REvoDesign.driver.ui_driver.HeadlessProtocol
¶
Bases: Protocol
Defines a protocol for objects that can run in headless mode.
This class inherits from Protocol and is primarily used for type annotations and type checking.
It includes an attribute headless of type bool, which indicates whether the object runs in headless mode.
Attributes:
| Name | Type | Description |
|---|---|---|
headless |
bool
|
bool -- A boolean attribute indicating whether the object runs in headless mode. |
require_non_headless decorator¶
REvoDesign.driver.ui_driver.require_non_headless(method)
¶
A decorator to ensure that certain methods are only called when the application is not running in headless mode.
It also prevents the method from being used with partial.
Parameters: - method (Callable[..., Any]): The method to be decorated.
Returns: - Callable[..., Any]: The wrapped method.
Widget Link¶
PushButtons¶
A frozen dataclass holding the canonical list of all push button IDs used across REvoDesign tabs.
REvoDesign.driver.widget_link.PushButtons
dataclass
¶
A class to define the IDs of push buttons used in the application.
Attributes:
| Name | Type | Description |
|---|---|---|
button_ids |
list[str]
|
A list of button IDs. |
Config2WidgetIds¶
A frozen dataclass that maps configuration item keys to widget IDs and classifies widget types (e.g. pushButton → QPushButton, comboBox → QComboBox).
REvoDesign.driver.widget_link.Config2WidgetIds
dataclass
¶
This class defines the mappings between configuration items and widget IDs, as well as the widget types.
Attributes:
| Name | Type | Description |
|---|---|---|
wi_types |
immutabledict
|
A mapping of widget type names to their corresponding Qt widget classes. |
c2wi |
immutabledict[str, str]
|
A mapping of configuration item keys to widget IDs. |
Methods:
| Name | Description |
|---|---|
get_widget_typing |
str): Returns the Qt widget class corresponding to the given widget ID. |
wi_types = immutabledict({'pushButton': QtWidgets.QPushButton, 'lineEdit': QtWidgets.QLineEdit, 'comboBox': QtWidgets.QComboBox, 'spinBox': QtWidgets.QSpinBox, 'doubleSpinBox': QtWidgets.QDoubleSpinBox, 'checkBox': QtWidgets.QCheckBox})
class-attribute
instance-attribute
¶
c2wi = immutabledict({'ui.header_panel.cmap.default': 'comboBox_cmap', 'ui.prepare.cofactor_radius': 'doubleSpinBox_cofactor_radius', 'ui.prepare.ligand_radius': 'doubleSpinBox_ligand_radius', 'ui.prepare.chain_dist': 'doubleSpinBox_interface_cutoff', 'ui.prepare.surface_probe_radius': 'doubleSpinBox_surface_cutoff', 'ui.header_panel.cmap.reverse_score': 'checkBox_reverse_mutant_effect', 'ui.mutate.max_score': 'lineEdit_score_maxima', 'ui.mutate.min_score': 'lineEdit_score_minima', 'ui.mutate.reject': 'lineEdit_reject_substitution', 'ui.mutate.accept': 'lineEdit_preffer_substitution', 'ui.mutate.designer.randomized_sampling': 'spinBox_randomized_sampling', 'ui.mutate.designer.enable_randomized_sampling': 'checkBox_randomized_sampling', 'ui.mutate.designer.deduplicate_designs': 'checkBox_deduplicate_designs', 'ui.mutate.designer.homooligomeric': 'checkBox_designer_homooligomeric', 'ui.mutate.designer.batch': 'spinBox_designer_batch', 'ui.mutate.designer.num_sample': 'spinBox_designer_num_samples', 'ui.mutate.designer.temperature': 'doubleSpinBox_designer_temperature', 'ui.cluster.score_matrix.default': 'comboBox_cluster_matrix', 'ui.cluster.method.use': 'comboBox_cluster_method', 'ui.cluster.shuffle': 'checkBox_shuffle_clustering', 'ui.cluster.mut_num_max': 'spinBox_num_mut_maximum', 'ui.cluster.mut_num_min': 'spinBox_num_mut_minimun', 'ui.cluster.num_cluster': 'spinBox_num_cluster', 'ui.cluster.batch_size': 'spinBox_cluster_batchsize', 'ui.cluster.random_seed': 'spinBox_cluster_random_seed', 'ui.cluster.mutate_relax': 'checkBox_cluster_mutate_and_relax', 'ui.cluster.rosetta.override_representatives': 'checkBox_cluster_rosetta_override_representatives', 'ui.cluster.evo.inputs.pssm_profile': 'lineEdit_cluster_evo_pssm_profile', 'ui.cluster.evo.inputs.esm1v_table': 'lineEdit_cluster_evo_esm1v_table', 'ui.cluster.evo.inputs.structure_pdb': 'lineEdit_cluster_evo_structure_pdb', 'ui.cluster.evo.esm.mutation_col': 'lineEdit_cluster_evo_esm_mutation_col', 'ui.cluster.evo.weights.seq': 'doubleSpinBox_cluster_evo_weight_seq', 'ui.cluster.evo.weights.physchem': 'doubleSpinBox_cluster_evo_weight_physchem', 'ui.cluster.evo.weights.spatial': 'doubleSpinBox_cluster_evo_weight_spatial', 'ui.cluster.evo.weights.pssm': 'doubleSpinBox_cluster_evo_weight_pssm', 'ui.cluster.evo.weights.esm': 'doubleSpinBox_cluster_evo_weight_esm', 'ui.visualize.global_score_policy': 'checkBox_global_score_policy', 'ui.interact.chain_binding.enabled': 'checkBox_interact_bind_chain_mode', 'ui.interact.chain_binding.chains_to_bind': 'lineEdit_interact_chain_binding', 'ui.interact.topN_pairs': 'spinBox_gremlin_topN', 'ui.interact.max_interact_dist': 'doubleSpinBox_max_interact_dist', 'ui.interact.use_external_scorer': 'comboBox_external_scorer', 'ui.socket.server_url': 'lineEdit_ws_server_url_to_connect', 'ui.socket.server_mode': 'checkBox_ws_server_mode', 'ui.socket.server_port': 'spinBox_ws_server_port', 'ui.socket.use_key': 'checkBox_ws_server_use_key', 'ui.socket.broadcast.interval': 'doubleSpinBox_ws_view_broadcast_interval', 'ui.socket.broadcast.view': 'checkBox_ws_broadcast_view', 'ui.socket.receive.mutagenesis': 'checkBox_ws_recieve_mutagenesis_broadcast', 'ui.socket.receive.view': 'checkBox_ws_recieve_view_broadcast', 'ui.config.sidechain_solver.use': 'comboBox_sidechain_solver', 'ui.config.sidechain_solver.repack_radius': 'doubleSpinBox_sidechain_solver_radius', 'ui.config.sidechain_solver.model': 'comboBox_sidechain_solver_model', 'ui.header_panel.input.molecule': 'comboBox_design_molecule', 'ui.header_panel.input.chain_id': 'comboBox_chain_id', 'ui.header_panel.nproc': 'spinBox_nproc', 'ui.prepare.input.pocket.to_pse': 'lineEdit_output_pse_pocket', 'ui.prepare.input.pocket.substrate': 'comboBox_ligand_sel', 'ui.prepare.input.pocket.cofactor': 'comboBox_cofactor_sel', 'ui.prepare.input.surface.to_pse': 'lineEdit_output_pse_surface', 'ui.prepare.input.surface.exclusion': 'comboBox_surface_exclusion', 'ui.mutate.input.to_pse': 'lineEdit_output_pse_mutate', 'ui.mutate.input.profile': 'lineEdit_input_csv', 'ui.mutate.input.profile_type': 'comboBox_profile_type', 'ui.mutate.input.design_case': 'lineEdit_design_case', 'ui.mutate.input.residue_ids': 'lineEdit_input_customized_indices', 'ui.evaluate.input.to_mutant_txt': 'lineEdit_output_mut_table', 'ui.evaluate.show_wt': 'checkBox_show_wt', 'ui.cluster.input.from_mutant_txt': 'lineEdit_input_mut_table', 'ui.visualize.input.to_pse': 'lineEdit_output_pse_visualize', 'ui.visualize.input.from_mutant_txt': 'lineEdit_input_mut_table_csv', 'ui.visualize.input.profile': 'lineEdit_input_csv_2', 'ui.visualize.input.profile_type': 'comboBox_profile_type_2', 'ui.visualize.input.group_name': 'comboBox_group_name', 'ui.visualize.input.best_leaf': 'comboBox_best_leaf', 'ui.visualize.input.totalscore': 'comboBox_totalscore', 'ui.visualize.input.multi_design.to_mutant_txt': 'lineEdit_multi_design_mutant_table', 'ui.visualize.multi_design.num_mut_max': 'spinBox_maximal_mutant_num', 'ui.visualize.multi_design.num_variant_max': 'spinBox_maximal_multi_design_variant_num', 'ui.visualize.multi_design.spatial_dist': 'doubleSpinBox_minmal_mutant_distance', 'ui.visualize.multi_design.use_bond_CA': 'checkBox_multi_design_bond_CA', 'ui.visualize.multi_design.use_sidechain_orientation': 'checkBox_multi_design_check_sidechain_orientations', 'ui.visualize.multi_design.use_external_scorer': 'checkBox_multi_design_use_external_scorer', 'ui.visualize.multi_design.color_by_scores': 'checkBox_multi_design_color_by_scores', 'ui.interact.input.gremlin_pkl': 'lineEdit_input_gremlin_mtx', 'ui.interact.input.to_mutant_txt': 'lineEdit_output_mutant_table', 'ui.socket.input.key': 'lineEdit_ws_server_key', 'rosetta.node_hint': 'comboBox_rosetta_node_hint'})
class-attribute
instance-attribute
¶
get_widget_typing(widget_id)
¶
Returns the Qt widget class corresponding to the given widget ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
widget_id
|
str
|
The ID of the widget. |
required |
Returns:
| Type | Description |
|---|---|
|
QtWidgets.QWidget: The corresponding Qt widget class. |
Group Registry¶
GroupRegistryItem¶
A frozen dataclass representing a single group registry entry — pairs a configuration item name with callables that dynamically generate its available values.
REvoDesign.basic.group_registries.GroupRegistryItem
dataclass
¶
A data class representing an item in a group registry.
Attributes:
| Name | Type | Description |
|---|---|---|
cfg_item |
str
|
The configuration item associated with this registry entry. |
group_generators |
tuple[Callable[[], Union[List[str], Dict[str, Any]]], ...]
|
A tuple of callables that generate groups. Each callable returns either a list of strings or a dictionary. |
CallableGroupValues¶
Static-method namespace providing all the callables used as group generators for dropdown menus across the UI.
REvoDesign.driver.group_register.CallableGroupValues
¶
list_some_blanks(n=1)
staticmethod
¶
list_score_matrix()
staticmethod
¶
list_color_map()
staticmethod
¶
list_installed_mutate_runners()
staticmethod
¶
list_all_profile_parsers()
staticmethod
¶
list_all_designers()
staticmethod
¶
list_all_scorers()
staticmethod
¶
list_all_rosetta_node_hints()
staticmethod
¶
list_cluster_methods()
staticmethod
¶
GroupRegistryCollection¶
Module-level tuple that collects all GroupRegistryItem instances used to populate combo boxes (color maps, score matrices, cluster methods, profile types, scorers, sidechain solvers, Rosetta node hints).
REvoDesign.driver.group_register.GroupRegistryCollection = (GroupCmap, GroupScoreMatrix, GroupClusterMethod, GroupProfileTypeTabMutate, GroupProfileTypeTabVisualize, GroupScorerTabInteract, GroupSidechainSolver, GroupRosettaNodeHint)
module-attribute
¶
File Dialog¶
IO_MODE¶
Type alias for file I/O operations: Literal["r", "w"].
REvoDesign.driver.file_dialog.IO_MODE = Literal['r', 'w']
module-attribute
¶
FileDialog¶
Singleton providing centralized file browsing, opening, and saving across all tabs. Connects browse buttons to config items automatically.
REvoDesign.driver.file_dialog.FileDialog
¶
Bases: SingletonAbstract
FileDialog class inherits from SingletonAbstract to implement a singleton pattern for file dialog functionality. This ensures that file dialog operations are centralized and shareable across different tabs.
singleton_init(window, pwd)
¶
Initializes the singleton instance of FileDialog.
Parameters: - window: Optional[Any] - The window object where the file dialog is displayed. - pwd: Optional[str] - The current working directory, if not provided, defaults to the system's current working directory.
This method initializes the file dialog with the provided window and directory, registers file dialog buttons, and marks the instance as initialized.
browse_multiple_files(exts=(file_extensions.Any,))
¶
browse_filename(mode='r', exts=(file_extensions.Any,))
¶
Open Finder/Explorer to browse from a filename
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
IO_MODE
|
mode to open this file. Defaults to 'r'. |
'r'
|
exts
|
tuple
|
file extention group. Defaults to [FileExtentions.Any]. |
(Any,)
|
Returns:
| Type | Description |
|---|---|
str | None
|
str, optional: selected filename or None if canceled. |
open_file(cfg_item, exts=(file_extensions.Any,))
¶
Open Any File
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg_input
|
str
|
Configure item in ConfigBus |
required |
exts
|
tuple
|
File Extention(s). Defaults to (FileExtentions.Any,). |
(Any,)
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str | None
|
filepath of opened file. |
open_mutant_table(cfg_mutant_table, mode='r')
¶
Open a mutant table file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg_mutant_table
|
str
|
Config item in ConfigBus |
required |
mode
|
IO_MODE
|
file operator mode. Defaults to 'r'. |
'r'
|
register_file_dialog_buttons()
¶
flatten_compressed_files¶
Utility function that extracts a compressed archive into an expanded_compressed_files/ subdirectory and returns the extraction path.
REvoDesign.driver.file_dialog.flatten_compressed_files(compressed_file, target_dir=None)
¶
Flattens and extracts the contents of a compressed file.
Parameters: - compressed_file (str): The path to the compressed file to be extracted. - target_dir (Optional[str]): The directory where the extracted files will be placed. If not provided, the current working directory is used.
Returns: - str: The path to the directory where the files have been extracted.
Environment Registration¶
register_environment_variables¶
Reads environment variable bindings from the environ.yaml configuration file and exports them to os.environ. Must be called after ConfigBus initialization.
REvoDesign.driver.environ_register.register_environment_variables()
¶
Parameter Toggle Registration¶
ParamChangeRegistryItem¶
A frozen dataclass that defines how a change in one widget should propagate to another configuration item via a widget signal.
REvoDesign.basic.param_toggle.ParamChangeRegistryItem
dataclass
¶
A class that registers a mapping between two config items.
This class is used to define how a change in one configuration item (source_cfg_item) should be mapped and registered to another configuration item (target_cfg_item) through a UI widget signal. It uses a dictionary to map parameter values.
Attributes:
| Name | Type | Description |
|---|---|---|
widget_name |
str
|
The name of the UI widget. |
widget_signal_name |
str
|
The name of the signal on the widget. |
source_cfg_item |
str
|
The name of the source configuration item. |
target_cfg_item |
str
|
The name of the target configuration item. |
param_mapping |
Dict[Any, Tuple]
|
A dictionary mapping parameter values from the source to the target. |
widget_signal(ui)
¶
Retrieves the specified signal from the specified widget on the UI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ui
|
Any
|
The UI instance containing the widgets. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
QtEventSignal |
pyqtBoundSignal
|
The signal associated with the widget. |
Raises:
| Type | Description |
|---|---|
InternalError
|
If the widget does not have the specified signal. |
register(register_func, ui)
¶
Registers the mapping between two configuration items by connecting the widget signal to the registration function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
register_func
|
Callable[[str, str, Dict[str, Tuple]], None]
|
The function to be called when the signal is emitted. |
required |
ui
|
Any
|
The UI instance containing the widgets. |
required |
ParamChangeRegister¶
A dataclass that collects multiple ParamChangeRegistryItem instances and registers them all with a shared callback function.
REvoDesign.basic.param_toggle.ParamChangeRegister
dataclass
¶
A data class to register parameter change functions.
- register_func: Callable[[str, str, Dict[str, Tuple]], None] A function that registers a parameter change handler.
- registry: tuple[ParamChangeRegistryItem, ...] A tuple of items to be registered.
register_all(ui)
¶
Registers all items in the registry using the provided register function and UI.
Parameters: - ui: The user interface object used for registration.
ParamChangeCollections¶
The concrete ParamChangeRegister instance used by the driver, connecting sidechain-solver weight changes and profile-type prefer_lower toggles.