Skip to content

GH-18: feat(pipeline): Add serialization for pipeline scores#61

Merged
Urfoex merged 1 commit intodevelopfrom
feature/GH-18-serialize-pipeline-scores
Aug 29, 2025
Merged

GH-18: feat(pipeline): Add serialization for pipeline scores#61
Urfoex merged 1 commit intodevelopfrom
feature/GH-18-serialize-pipeline-scores

Conversation

@Urfoex
Copy link
Collaborator

@Urfoex Urfoex commented Aug 22, 2025

Adds Pydantic models and serialization logic for pipeline.scores. This includes support for both classification and regression scores, which are handled as a discriminated union.

  • Defines ClassificationScore and RegressionScore Pydantic models.
  • Implements serialize_scores to convert getML scores into the new models.
  • Adds a custom WrongPipelineScoreTypeError exception for score type mismatches during serialization.
  • Updates the PipelineInformation model and associated tests to include the new scores field.

Resolves #18

@Urfoex Urfoex requested a review from Copilot August 22, 2025 16:10
@Urfoex Urfoex self-assigned this Aug 22, 2025
@Urfoex Urfoex added the enhancement New feature or request label Aug 22, 2025
@Urfoex Urfoex linked an issue Aug 22, 2025 that may be closed by this pull request
12 tasks
Copy link

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

Adds serialization support for pipeline scores by implementing Pydantic models and serialization logic to handle both classification and regression score types as a discriminated union.

  • Implements ClassificationScore and RegressionScore Pydantic models with type discrimination
  • Adds serialize_scores function to convert getML scores into the new models with type validation
  • Updates PipelineInformation model to include the new scores field with comprehensive test coverage

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/getml_io/getml/scores.py Defines Pydantic models for classification and regression scores with discriminated union
src/getml_io/serialize/pipeline.py Implements score serialization logic with type validation and error handling
src/getml_io/serialize/exception.py Adds custom exception for score type mismatches during serialization
src/getml_io/metadata/pipeline_information.py Updates PipelineInformation model to include scores field
Test files Comprehensive test coverage for score serialization and pipeline information updates

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces serialization for pipeline scores, a valuable addition. The implementation is well-structured, defining Pydantic models for different score types, adding serialization logic, and including comprehensive tests. My review focuses on a few areas for improvement: refining the Pydantic model for scores to be more idiomatic and flexible, optimizing the serialization functions for better performance and readability, and strengthening the test assertions to be more comprehensive.

@Urfoex Urfoex force-pushed the feature/GH-18-serialize-pipeline-scores branch from 4a919d7 to d8cdb40 Compare August 22, 2025 16:18
@Urfoex Urfoex requested review from awaismirza92 and srnnkls August 22, 2025 16:19
Copy link
Collaborator

@srnnkls srnnkls left a comment

Choose a reason for hiding this comment

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

Perfect.

Copy link

@awaismirza92 awaismirza92 left a comment

Choose a reason for hiding this comment

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

LGTM

@Urfoex Urfoex marked this pull request as ready for review August 29, 2025 03:09
@Urfoex Urfoex force-pushed the feature/GH-17-serialize-pipeline-features branch from 8e973bd to a34c757 Compare August 29, 2025 20:38
Base automatically changed from feature/GH-17-serialize-pipeline-features to develop August 29, 2025 20:39
Adds Pydantic models and serialization logic for `pipeline.scores`. This includes support for both classification and regression scores, which are handled as a discriminated union.

- Defines `ClassificationScore` and `RegressionScore` Pydantic models.
- Implements `serialize_scores` to convert getML scores into the new models.
- Adds a custom `WrongPipelineScoreTypeError` exception for score type mismatches during serialization.
- Updates the `PipelineInformation` model and associated tests to include the new `scores` field.

Resolves #18
@Urfoex Urfoex force-pushed the feature/GH-18-serialize-pipeline-scores branch from d8cdb40 to a8d9594 Compare August 29, 2025 20:40
@Urfoex Urfoex merged commit 24c3512 into develop Aug 29, 2025
0 of 3 checks passed
@Urfoex Urfoex deleted the feature/GH-18-serialize-pipeline-scores branch August 29, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement scores metadata serializers

3 participants

Comments