tessl install tessl/pypi-yacs@0.1.0A lightweight library for defining and managing system configurations for scientific experimentation.
Agent Success
Agent success rate when using this tile
97%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.05x
Baseline
Agent success rate without this tile
92%
Build a configuration migration helper that manages config schema evolution when configuration keys are renamed.
Your tool should help users migrate old configuration files when the schema changes. Specifically:
Create a configuration system that defines a default config schema with the following structure:
MODEL.ARCHITECTURE (string) - the model architecture nameTRAINING.BATCH_SIZE (integer) - training batch sizeTRAINING.OPTIMIZER (string) - optimizer nameRegister key renames to handle backward compatibility:
MODEL.TYPE has been renamed to MODEL.ARCHITECTURETRAIN.BATCH_SIZE has been renamed to TRAINING.BATCH_SIZEImplement a function load_config(config_overrides) that:
["MODEL.TYPE", "resnet", "TRAIN.BATCH_SIZE", 32])The error messages should help users understand what needs to be updated in their configuration files.
When attempting to use the old key MODEL.TYPE with value "resnet50", an error is raised that mentions both the old key name and the new key name MODEL.ARCHITECTURE. @test
When attempting to use the old key TRAIN.BATCH_SIZE with value 64, an error is raised that mentions both the old key name and the new key name TRAINING.BATCH_SIZE. @test
When using the correct new key MODEL.ARCHITECTURE with value "vgg16", the configuration loads successfully without errors. @test
When using the correct new key TRAINING.BATCH_SIZE with value 128, the configuration loads successfully without errors. @test
@generates
def load_config(config_overrides):
"""
Load configuration with the provided overrides.
Args:
config_overrides: List of alternating keys and values to override
Example: ["MODEL.ARCHITECTURE", "resnet", "TRAINING.BATCH_SIZE", 32]
Returns:
Configuration object with merged values
Raises:
KeyError: When a renamed key is used, with a message indicating
the old and new key names
"""
passProvides configuration management with key rename tracking.