Conversation
Co-authored-by: diogo.ansantos <diogo.ansantos@nos.pt>
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a comprehensive configuration management system for the skdr-eval library. The implementation provides structured configuration handling for evaluation, model, and visualization settings with validation and file persistence capabilities.
- Adds three main configuration dataclasses:
EvaluationConfig,ModelConfig, andVisualizationConfig - Implements a
ConfigManagerclass for saving/loading configurations to/from YAML/JSON files - Provides utility functions for configuration merging, validation, and file operations
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 75 comments.
| File | Description |
|---|---|
| src/skdr_eval/config.py | New configuration module with dataclasses, manager, and utility functions |
| src/skdr_eval/init.py | Exports configuration classes and functions in the public API |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| n_splits: int = 3 | ||
| random_state: int = 42 | ||
| min_ess_frac: float = 0.02 | ||
|
|
There was a problem hiding this comment.
Remove trailing whitespace on line 25.
|
|
||
| # Clipping parameters | ||
| clip_grid: List[float] = None | ||
|
|
There was a problem hiding this comment.
Remove trailing whitespace on line 28.
| n_boot: int = 400 | ||
| block_len: Optional[int] = None | ||
| alpha: float = 0.05 | ||
|
|
There was a problem hiding this comment.
Remove trailing whitespace on line 33.
| # Policy training parameters | ||
| policy_train: str = "all" | ||
| policy_train_frac: float = 0.85 | ||
|
|
There was a problem hiding this comment.
Remove trailing whitespace on line 41.
| topk: int = 20 | ||
| neg_per_pos: int = 5 | ||
| chunk_pairs: int = 2_000_000 | ||
|
|
There was a problem hiding this comment.
Remove trailing whitespace on line 48.
| Path to save configuration file. | ||
| """ | ||
| filename = Path(filename) | ||
|
|
There was a problem hiding this comment.
Remove trailing whitespace on line 515.
| Merged configuration. | ||
| """ | ||
| merged = {} | ||
|
|
There was a problem hiding this comment.
Remove trailing whitespace on line 546.
| merged[key] = merge_configs(merged[key], value) | ||
| else: | ||
| merged[key] = value | ||
|
|
There was a problem hiding this comment.
Remove trailing whitespace on line 554.
| eval_config = EvaluationConfig(**config["evaluation"]) | ||
|
|
||
| # Validate model config if present | ||
| if "model" in config: | ||
| model_config = ModelConfig(**config["model"]) | ||
|
|
||
| # Validate visualization config if present | ||
| if "visualization" in config: | ||
| viz_config = VisualizationConfig(**config["visualization"]) | ||
|
|
There was a problem hiding this comment.
Remove trailing whitespace on lines 575, 579, and remove unused variables eval_config, model_config, and viz_config as they are created but not used.
| eval_config = EvaluationConfig(**config["evaluation"]) | |
| # Validate model config if present | |
| if "model" in config: | |
| model_config = ModelConfig(**config["model"]) | |
| # Validate visualization config if present | |
| if "visualization" in config: | |
| viz_config = VisualizationConfig(**config["visualization"]) | |
| EvaluationConfig(**config["evaluation"]) | |
| # Validate model config if present | |
| if "model" in config: | |
| ModelConfig(**config["model"]) | |
| # Validate visualization config if present | |
| if "visualization" in config: | |
| VisualizationConfig(**config["visualization"]) |
| # Validate visualization config if present | ||
| if "visualization" in config: | ||
| viz_config = VisualizationConfig(**config["visualization"]) | ||
|
|
There was a problem hiding this comment.
Remove trailing whitespace on line 583.
Pull Request
📋 Description
Type of Change
🔗 Related Issues
🧪 Testing
Test Coverage
Manual Testing
make checkTest commands run:
# List the commands you used to test make check python examples/quickstart.py📝 Changes Made
Code Changes
API Changes
API changes:
📚 Documentation
✅ Checklist
Code Quality
ruff checkandruff formatmypytype checkingTesting & CI
Documentation & Communication
🔍 Review Notes
Focus Areas
Questions for Reviewers
📸 Screenshots/Examples
🚀 Deployment Notes
Additional Context: