or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/yacs@0.1.x
tile.json

tessl/pypi-yacs

tessl install tessl/pypi-yacs@0.1.0

A 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%

task.mdevals/scenario-8/

Configuration Migration Tool

Build a configuration migration helper that manages config schema evolution when configuration keys are renamed.

Requirements

Your tool should help users migrate old configuration files when the schema changes. Specifically:

  1. Create a configuration system that defines a default config schema with the following structure:

    • MODEL.ARCHITECTURE (string) - the model architecture name
    • TRAINING.BATCH_SIZE (integer) - training batch size
    • TRAINING.OPTIMIZER (string) - optimizer name
  2. Register key renames to handle backward compatibility:

    • MODEL.TYPE has been renamed to MODEL.ARCHITECTURE
    • TRAIN.BATCH_SIZE has been renamed to TRAINING.BATCH_SIZE
  3. Implement a function load_config(config_overrides) that:

    • Takes a list of key-value pairs (e.g., ["MODEL.TYPE", "resnet", "TRAIN.BATCH_SIZE", 32])
    • Attempts to merge these overrides into the base configuration
    • Should raise an informative error when a renamed key is used
    • The error message must clearly indicate the old key name and the new key name
  4. The error messages should help users understand what needs to be updated in their configuration files.

Test Cases

  • 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

Implementation

@generates

API

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
    """
    pass

Dependencies { .dependencies }

yacs { .dependency }

Provides configuration management with key rename tracking.