ml_switcheroo.discovery.scaffolder ================================== .. py:module:: ml_switcheroo.discovery.scaffolder .. autoapi-nested-parse:: Scaffolding Tool for Knowledge Base Discovery. This module provides the `Scaffolder` class, which inspects installed libraries (Torch, JAX, etc.) and aligns them against the Specification-Guided Knowledge Base. Optimization Update: - Implements Indexing for Catalog Lookups to prevent O(N^2) complexity when aligning massive frameworks (Torch vs JAX). - Uses pre-computed indices keyed by lowercase API names for fast retrieval. Classes ------- .. autoapisummary:: ml_switcheroo.discovery.scaffolder.Scaffolder Module Contents --------------- .. py:class:: Scaffolder(semantics: Optional[ml_switcheroo.semantics.manager.SemanticsManager] = None, similarity_threshold: float = 0.8, arity_penalty: float = 0.3) Automated discovery tool that aligns framework APIs. Optimized with catalog indexing to handle large-scale API surfaces efficiently. .. py:attribute:: inspector .. py:attribute:: console .. py:attribute:: semantics .. py:attribute:: similarity_threshold :value: 0.8 .. py:attribute:: arity_penalty :value: 0.3 .. py:attribute:: staged_specs :type: Dict[str, Dict[str, Any]] .. py:attribute:: staged_mappings :type: Dict[str, Dict[str, Any]] .. py:method:: scaffold(frameworks: List[str], root_dir: Optional[pathlib.Path] = None) Main entry point. Scans frameworks and builds/updates JSON mappings.