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 utility that loads and merges configuration settings from external files into a configuration object. The utility should handle both YAML and Python configuration files and properly compose configurations from multiple sources.
Your implementation should:
The base configuration should include:
MODEL section with TYPE (string) and NUM_LAYERS (integer)TRAIN section with LEARNING_RATE (float), BATCH_SIZE (integer), and EPOCHS (integer)DATA section with PATH (string) and AUGMENT (boolean)MODEL.TYPE to "resnet50" updates the configuration correctly @testTRAIN.LEARNING_RATE to 0.001 updates the configuration correctly @test@generates
def create_base_config():
"""
Creates and returns the base configuration with default values.
Returns:
A configuration object with default settings for MODEL, TRAIN, and DATA sections
"""
pass
def merge_from_file(config, filepath):
"""
Loads configuration from a YAML or Python file and merges it into the provided config.
Args:
config: The configuration object to merge into
filepath: Path to the YAML (.yaml, .yml) or Python (.py) file
Returns:
The updated configuration object
Raises:
FileNotFoundError: If the file does not exist
"""
pass
def get_value(config, key_path):
"""
Retrieves a configuration value using dot notation.
Args:
config: The configuration object
key_path: Dot-separated path to the value (e.g., "MODEL.TYPE" or "TRAIN.LEARNING_RATE")
Returns:
The value at the specified path
"""
passProvides configuration management with file merging capabilities.
yacs==0.1.8