ml_switcheroo.cli.handlers.convert ================================== .. py:module:: ml_switcheroo.cli.handlers.convert .. autoapi-nested-parse:: Convert Command Handler. This module implements the logic for the `ml_switcheroo convert` command. It orchestrates: 1. Configuration loading (including external plugin discovery). 2. Semantics initialization. 3. AST transformation via the Engine. 4. Verification harness generation (optional). 5. Output writing and trace logging. Functions --------- .. autoapisummary:: ml_switcheroo.cli.handlers.convert.handle_convert Module Contents --------------- .. py:function:: handle_convert(input_path: pathlib.Path, output_path: Optional[pathlib.Path], source: Optional[str], target: Optional[str], verify: bool, strict: Optional[bool], plugin_settings: Dict[str, Any], json_trace_path: Optional[pathlib.Path] = None) -> int Handles the 'convert' command execution. Orchestrates the loading of configuration, initialization of the semantic knowledge base, and the execution of the transpilation engine on files or directories. :param input_path: Path to the source file or directory to convert. :param output_path: Path where generated code should be saved. :param source: Override for source framework (e.g. 'torch'). :param target: Override for target framework (e.g. 'jax'). :param verify: If True, generates and runs a verification harness test immediately. :param strict: If True, enforces strict strict_mode on the Engine. :param plugin_settings: Dictionary of specific plugin configuration flags. :param json_trace_path: Optional path to dump execution trace JSON. :returns: Exit code (0 for success, 1 for failure). :rtype: int