-
Notifications
You must be signed in to change notification settings - Fork 0
Replacing Solution struct with Solution Interface
#17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17 +/- ##
==========================================
+ Coverage 86.76% 87.33% +0.56%
==========================================
Files 27 35 +8
Lines 3687 4136 +449
==========================================
+ Hits 3199 3612 +413
- Misses 440 470 +30
- Partials 48 54 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 refactors the solution handling by replacing the concrete Solution struct with a Solution interface, moving solution-related code from the problem package to a new solution package. This enables more flexible implementations of solutions while maintaining backward compatibility through helper functions.
Key changes:
- Replaced concrete
Solutionstruct withSolutioninterface to allow custom implementations - Created new
solutionpackage with interface definition and helper functions - Moved and simplified status constants from
OptimizationStatus_*to shorter names likeNODE_LIMIT
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| testing/solution/solution_test.go | Updated tests to use new solution interface and helper functions |
| solution/status/status.go | New file defining SolutionStatus type with shortened constant names |
| solution/solution.go | New interface definition with helper functions for value extraction |
| solution/dummy_solution.go | Implementation of Solution interface for testing purposes |
| problem/solution.go | Removed old Solution struct and status definitions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Summary
Solutionstruct with theSolutioninterface. This should allow anyone to define their own form ofSolutioninterface.SolutionandSolutionStatusout of theproblempackage.Notes
Also, we renamed the
SolutionStatusvalues to be a bit shorter.