Skip to content

Checkpoint before follow-up message#19

Open
dgenio wants to merge 1 commit intodevelopfrom
feature/configuration-management
Open

Checkpoint before follow-up message#19
dgenio wants to merge 1 commit intodevelopfrom
feature/configuration-management

Conversation

@dgenio
Copy link
Owner

@dgenio dgenio commented Sep 14, 2025

Pull Request

📋 Description

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🧹 Code refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test improvements
  • 🔧 Build/CI improvements

🔗 Related Issues

  • Fixes #
  • Related to #

🧪 Testing

Test Coverage

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have added integration tests if applicable

Manual Testing

  • Tested locally with make check
  • Tested with example scripts
  • Tested edge cases

Test commands run:

# List the commands you used to test
make check
python examples/quickstart.py

📝 Changes Made

Code Changes

API Changes

  • No API changes
  • Backward compatible API additions
  • Breaking API changes (requires major version bump)

API changes:

📚 Documentation

  • I have updated the documentation accordingly
  • I have updated docstrings for new/modified functions
  • I have added examples if applicable
  • I have updated the CHANGELOG.md

✅ Checklist

Code Quality

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run ruff check and ruff format
  • I have run mypy type checking

Testing & CI

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • All CI checks pass
  • Code coverage is maintained or improved

Documentation & Communication

  • I have made corresponding changes to the documentation
  • My commit messages follow the conventional commit format
  • I have updated the CHANGELOG.md if applicable

🔍 Review Notes

Focus Areas

Questions for Reviewers

📸 Screenshots/Examples

# Example usage of new feature
import skdr_eval

# Your example here

🚀 Deployment Notes

  • No special deployment considerations
  • Requires database migrations
  • Requires environment variable changes
  • Requires dependency updates

Additional Context:

Co-authored-by: diogo.ansantos <diogo.ansantos@nos.pt>
@dgenio dgenio requested a review from Copilot September 14, 2025 10:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and VisualizationConfig
  • Implements a ConfigManager class 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

Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace on line 25.

Suggested change

Copilot uses AI. Check for mistakes.

# Clipping parameters
clip_grid: List[float] = None

Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace on line 28.

Suggested change

Copilot uses AI. Check for mistakes.
n_boot: int = 400
block_len: Optional[int] = None
alpha: float = 0.05

Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace on line 33.

Suggested change

Copilot uses AI. Check for mistakes.
# Policy training parameters
policy_train: str = "all"
policy_train_frac: float = 0.85

Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace on line 41.

Suggested change

Copilot uses AI. Check for mistakes.
topk: int = 20
neg_per_pos: int = 5
chunk_pairs: int = 2_000_000

Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace on line 48.

Suggested change

Copilot uses AI. Check for mistakes.
Path to save configuration file.
"""
filename = Path(filename)

Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace on line 515.

Copilot uses AI. Check for mistakes.
Merged configuration.
"""
merged = {}

Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace on line 546.

Suggested change

Copilot uses AI. Check for mistakes.
merged[key] = merge_configs(merged[key], value)
else:
merged[key] = value

Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace on line 554.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines +574 to +583
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"])

Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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"])

Copilot uses AI. Check for mistakes.
# Validate visualization config if present
if "visualization" in config:
viz_config = VisualizationConfig(**config["visualization"])

Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace on line 583.

Suggested change

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants