-
Notifications
You must be signed in to change notification settings - Fork 98
Add tests for result count of solution attributes #901
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
@@ Coverage Diff @@
## master #901 +/- ##
==========================================
- Coverage 95.1% 95.08% -0.03%
==========================================
Files 80 80
Lines 8518 8622 +104
==========================================
+ Hits 8101 8198 +97
- Misses 417 424 +7
Continue to review full report at Codecov.
|
|
We should define a custom error to enforce consistency between solvers wrappers, e.g., struct ResultIndexBoundsError{AttrType}
attr::AttrType
result_count::Int
end
function check_result_index_bounds(model::ModelLike, attr)
result_count = get(model, ResultCount())
if !(1 <= attr.result_index <= result_count)
throw(ResultIndexBoundsError(attr, result_count)
end
end
Base.showerror(...) = ... |
|
Thoughts on making a breaking change by renaming the fields from |
That would break MosekTools. We could instead create a |
|
Is the idea here that solvers would also call |
|
Yes, exactly, all solvers should do that. They could also call |
Closes #900