cursus.step_catalog.adapters.config_class_detector

Config class detector adapters for backward compatibility.

This module provides adapters that maintain existing config class detection APIs during the migration from legacy discovery systems to the unified StepCatalog system.

class ConfigClassDetectorAdapter(workspace_root=None)[source]

Bases: object

Adapter maintaining backward compatibility with ConfigClassDetector.

Replaces: src/cursus/core/config_fields/config_class_detector.py

MODERN APPROACH: Uses step catalog’s superior AST-based config discovery instead of legacy JSON parsing. This provides more accurate and comprehensive config class detection.

MODEL_TYPE_FIELD = '__model_type__'
METADATA_FIELD = 'metadata'
CONFIG_TYPES_FIELD = 'config_types'
CONFIGURATION_FIELD = 'configuration'
SPECIFIC_FIELD = 'specific'
static detect_from_json(config_path)[source]

MODERN APPROACH: Use step catalog’s AST-based discovery instead of JSON parsing.

This method now uses the superior AST-based discovery from the unified step catalog rather than the legacy JSON parsing approach. This provides more accurate and comprehensive config class detection by analyzing actual source code.

Real usage pattern (from dynamic_template.py): detected_classes = detect_config_classes_from_json(self.config_path)

Parameters:

config_path (str) – Path to configuration file (used to determine workspace root)

Returns:

Dictionary mapping config class names to config class types

Return type:

Dict[str, Any]

classmethod from_config_store(config_path)[source]

MODERN APPROACH: Use step catalog’s integrated discovery.

This method uses the step catalog’s build_complete_config_classes which integrates both AST-based discovery and ConfigClassStore registration, providing the most comprehensive config class detection.

class ConfigClassStoreAdapter[source]

Bases: object

Adapter maintaining backward compatibility with ConfigClassStore.

Replaces: src/cursus/core/config_fields/config_class_store.py (partial)

classmethod register(config_class=None)[source]

Legacy method: register a config class.

classmethod get_class(class_name)[source]

Legacy method: get a registered class by name.

classmethod get_all_classes()[source]

Legacy method: get all registered classes.

classmethod register_many(*config_classes)[source]

Legacy method: register multiple config classes at once.

classmethod clear()[source]

Legacy method: clear the registry.

classmethod registered_names()[source]

Legacy method: get all registered class names.

build_complete_config_classes(project_id=None)[source]

Legacy function: build complete config classes using catalog.

detect_config_classes_from_json(config_path)[source]

Legacy function: detect config classes using catalog.