injector_fw.core ================ .. py:module:: injector_fw.core .. autoapi-nested-parse:: Core Logic for Framework Definition Injection (JSON). This module provides the `FrameworkInjector` class, which handles the insertion or updating of Semantic Operations in the JSON definition files located in `src/ml_switcheroo/frameworks/definitions/`. It replaces the legacy LibCST-based injector that modified Python source code. Classes ------- .. autoapisummary:: injector_fw.core.FrameworkInjector Module Contents --------------- .. py:class:: FrameworkInjector(target_fw: str, op_name: str, variant: ml_switcheroo.core.dsl.FrameworkVariant) Injects a `FrameworkVariant` entry into the framework's JSON definitions. It handles: 1. Loading the existing JSON mapping. 2. Merging the new variant data. 3. Writing the updated JSON back to disk. .. py:attribute:: target_fw .. py:attribute:: op_name .. py:attribute:: variant .. py:attribute:: json_path .. py:attribute:: found :value: False .. py:method:: inject(dry_run: bool = False) -> bool Executes the injection process. :param dry_run: If True, prints changes to console instead of writing file. :returns: True if the operation was successful. :rtype: bool