CLI Tools
Modules powering the command-line interfaces.
- ensemble_analyzer.cli.check_setup.check_gaussian() None[source]
Check for Gaussian availability (Optional). Looks for ‘g16’ or ‘g09’ in PATH.
- ensemble_analyzer.cli.check_setup.check_ml_potentials() None[source]
Check optional ML potential dependencies (TBLite, AIMNet).
- ensemble_analyzer.cli.check_setup.check_models_dir() None[source]
Check ENAN_MODELS_DIR environment variable.
- ensemble_analyzer.cli.check_setup.check_orca() bool[source]
Verify ORCA installation and environment configuration.
Checks: 1. ‘orca’ executable in PATH. 2. ‘ORCAVERSION’ environment variable.
- Returns:
True if ORCA is correctly configured.
- Return type:
bool
- ensemble_analyzer.cli.check_setup.check_python_dependencies() bool[source]
Verify that all required Python libraries are installed and importable.
- Returns:
True if all critical dependencies are found.
- Return type:
bool
Interactive Protocol Wizard for Ensemble Analyser Requires: Python >= 3.10, InquirerPy
- ensemble_analyzer.cli.protocol_wizard.clean_protocol_dict(step: dict[str, Any]) dict[str, Any][source]
Remove None, empty values, and defaults from protocol dictionary.
- ensemble_analyzer.cli.protocol_wizard.get_constrains() list[list[int]][source]
Prompt for geometric constraints.
- ensemble_analyzer.cli.protocol_wizard.get_float_input(message: str, default: str = '', allow_empty: bool = True) float | None[source]
Safe float input with optional empty value.
- ensemble_analyzer.cli.protocol_wizard.get_int_input(message: str, default: str = '1') int[source]
Safe integer input with validation and retry.
- ensemble_analyzer.cli.protocol_wizard.get_internal_coordinates() list[list[int]][source]
Prompt for internal coordinates to monitor (bond/angle/dihedral).
- ensemble_analyzer.cli.protocol_wizard.load_basis_sets() dict[str, Any][source]
Interactively configure a single protocol step.
Prompts the user for parameters (calculator, method, settings) based on the selected complexity level.
- Parameters:
step_num (int) – The index of the step being configured.
level (str, optional) – Configuration depth (‘Basic’, ‘Intermediate’, ‘Advanced’). Defaults to “Basic”.
- Returns:
Dictionary of parameters for this protocol step.
- Return type:
dict[str, Any]
- ensemble_analyzer.cli.protocol_wizard.load_functionals() list[str][source]
Load available DFT functionals from the package database.
- Returns:
List of functional names.
- Return type:
list[str]
- ensemble_analyzer.cli.protocol_wizard.load_grouped(path: str) list[str][source]
Load grouped choices (functionals/basis sets) from a parameter file.
Parses files with ‘#!’ category markers to group options for the UI.
- Parameters:
path (str) – Path to the parameters file.
- Returns:
List of formatted choices for the fuzzy search prompt.
- Return type:
list[str]
- ensemble_analyzer.cli.protocol_wizard.main() int[source]
Main entry point for the Protocol Wizard CLI.
Orchestrates the creation of the protocol.json file through an interactive terminal session.
- Returns:
Exit code (0 for success, 1 for error).
- Return type:
int
- ensemble_analyzer.cli.protocol_wizard.parse_choice(choice: str) str[source]
Extract clean value from formatted choice string.
- ensemble_analyzer.cli.protocol_wizard.print_step_summary(idx: int, step: dict[str, Any]) None[source]
Print formatted summary of protocol step.
- ensemble_analyzer.cli.protocol_wizard.protocol_step(step_num: int, level: str = 'Basic') dict[str, Any][source]
Create a single protocol step with level-dependent options.
- Parameters:
step_num – Step number in the protocol
level – Configuration level (Basic/Intermediate/Advanced)
- Returns:
Dictionary containing all protocol parameters
Graph Editor
Core module for MatplotlibPickleEditor.
Handles loading, modifying and saving serialized matplotlib figures.
- class ensemble_analyzer.cli.pickle_editor.core.MatplotlibPickleEditor(pickle_path: Path, strict_validation: bool = True)[source]
Core editor to modify colors, labels, and styles in serialized matplotlib figures.
- COMMON_COLORS
List of common predefined colors for quick selection.
- Type:
List[str]
- change_line_alpha(alpha_map: Dict[str, float]) int[source]
Change line transparency and legend transparency.
- Parameters:
alpha_map – Dictionary {label: alpha} (0-1)
- Returns:
Number of alpha values changed
- Raises:
RuntimeError – If load() has not been called
- change_line_colors(label_color_map: Dict[str, str]) int[source]
Update the color of lines associated with specific legend labels.
- Parameters:
label_color_map (Dict[str, str]) – Map of {label: hex_color/name}.
- Returns:
Number of lines updated.
- Return type:
int
- change_line_linestyle(style_map: Dict[str, str]) int[source]
Update the line style (e.g., solid, dashed) for specific labels.
- Parameters:
style_map (Dict[str, str]) – Map of {label: style_string} (e.g. ‘–‘).
- Returns:
Number of lines updated.
- Return type:
int
- change_line_linewidth(width_map: Dict[str, float]) int[source]
Change line widths and legend widths.
- Parameters:
width_map – Dictionary {label: width}
- Returns:
Number of widths changed
- Raises:
RuntimeError – If load() has not been called
- change_line_visibility(visibility_map: Dict[str, bool]) int[source]
Change line visibility (show/hide).
- Parameters:
visibility_map – Dictionary {label: bool} (True=visible, False=hidden)
- Returns:
Number of lines changed
- Raises:
RuntimeError – If load() has not been called
- get_legend_labels() Dict[int, str][source]
Retrieve current legend labels mapped by index.
- Returns:
Dictionary {index: label_text}.
- Return type:
Dict[int, str]
- get_line_colors() Dict[str, str][source]
Get current line colors.
- Returns:
hex_color}
- Return type:
Dictionary {label
- Raises:
RuntimeError – If load() has not been called
- has_modifications() bool[source]
Check if there are unsaved modifications.
- Returns:
True if there are unsaved modifications
- load() None[source]
Load and deserialize the pickle file.
- Raises:
PickleSecurityError – If the file is corrupted or not a valid Figure.
- preview() None[source]
Display a copy of the current figure for preview.
- Raises:
RuntimeError – If load() has not been called
- rename_legend_labels(mapping: Dict[str, str]) int[source]
Rename specific legend labels.
- Parameters:
mapping (Dict[str, str]) – Map of {old_name: new_name}.
- Returns:
Number of labels successfully renamed.
- Return type:
int
- save(output_path: Path | None = None, format: str = 'pickle') Path[source]
Serialize the modified figure to disk.
- Parameters:
output_path (Optional[Path]) – Destination file. If None, overwrites original.
format (str) – Output format (‘pickle’, ‘png’, ‘pdf’, ‘svg’).
- Returns:
The actual path of the saved file.
- Return type:
Path
- exception ensemble_analyzer.cli.pickle_editor.core.PickleSecurityError[source]
Exception for security issues in pickle loading.
CLI entry point for Matplotlib Pickle Editor.
Supports interactive (TUI) and batch modes.
- ensemble_analyzer.cli.pickle_editor.cli.batch_mode(args: Namespace) int[source]
Execute edits in non-interactive (batch) mode.
- Parameters:
args – Parsed command-line arguments.
- Returns:
Exit code (0 for success, 1 for error).
- Return type:
int
- ensemble_analyzer.cli.pickle_editor.cli.main() int[source]
Main entry point for the Graph Editor CLI.
Dispatches control to either the TUI or Batch mode.
- Returns:
Exit code.
- Return type:
int
- ensemble_analyzer.cli.pickle_editor.cli.parse_mapping_file(filepath: Path) Dict[str, str][source]
Parse a text file containing ‘OLD=NEW’ mappings.
- Parameters:
filepath (Path) – Path to the mapping file.
- Returns:
Dictionary of mappings.
- Return type:
Dict[str, str]
Interactive Terminal User Interface for MatplotlibPickleEditor.
Interactive interface based on InquirerPy and Rich.
- class ensemble_analyzer.cli.pickle_editor.tui.InteractiveTUI(editor: MatplotlibPickleEditor)[source]
Terminal User Interface for the graph editor using InquirerPy.
- print_panel(message: str, title: str = 'Info', style: str = 'cyan') None[source]
Print a formatted panel.
- Parameters:
message – Message to display
title – Panel title
style – Border color style