CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-yacs

A lightweight library for defining and managing system configurations for scientific experimentation.

Overall
score

97%

Evaluation97%

1.05x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-8/

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

Install with Tessl CLI

npx tessl i tessl/pypi-yacs

tile.json