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-4/

Configuration File Converter

Build a configuration file converter that reads, modifies, and saves configuration data using YAML format.

Requirements

Create a Python module that provides functionality to load configuration data from YAML format, make modifications to it, and save it back to YAML format. The module should handle hierarchical configuration structures with various data types.

Your implementation should:

  1. Load configuration data from YAML strings
  2. Convert the loaded data into a structured format that supports both attribute-style and dictionary-style access
  3. Allow modifications to configuration values
  4. Serialize the modified configuration back to YAML format

Test Cases

  • Loading a YAML string with nested configuration (SYSTEM.NUM_GPUS=8, TRAIN.LEARNING_RATE=0.001) returns a structure where values can be accessed @test
  • Modifying a nested configuration value and serializing back to YAML preserves the hierarchical structure @test
  • Loading YAML with different data types (integers, floats, strings, tuples, lists) preserves type information @test
  • Serializing an empty configuration to YAML returns valid YAML output @test

Implementation

@generates

API

def load_from_yaml(yaml_string: str):
    """
    Load configuration from a YAML string.

    Args:
        yaml_string: A string containing YAML-formatted configuration data

    Returns:
        A configuration object that supports both attribute and dictionary access
    """
    pass

def dump_to_yaml(config) -> str:
    """
    Serialize a configuration object to a YAML string.

    Args:
        config: A configuration object to serialize

    Returns:
        A YAML-formatted string representation of the configuration
    """
    pass

Dependencies { .dependencies }

yacs { .dependency }

Provides configuration management with YAML serialization support.

@satisfied-by