Repository navigation
SCIP 11: Split Model into BaseModel and Model - #1292
Conversation
…mn/Row/NLRow to model.pxi
… addMatrixVar to Model and lint for dtype=float and Model returns
|
This should be the first to be merged for two reasons. One, it would make the diff in exact-solving much nicer. And two, we already have enough content for a minor release, and if we manage to merge this in there in time, then we can make use of eventual bug reports that come up. |
| raise ValueError("SCIP was built without exact solving support, ExactModel needs a SCIP build with exact solving enabled") | ||
| super().__init__(problemName, defaultPlugins, createscip=createscip, threadsafe=threadsafe) | ||
|
|
||
| cdef _configureScip(self): |
There was a problem hiding this comment.
Has to be like this because SCIPenableExactSolving() must be called in the INIT stage, and the way we're creating the model above puts us directly in the problem stage.
There was a problem hiding this comment.
And we're creating the model this way to avoid duplication only?
There was a problem hiding this comment.
Yes, but indeed the duplication was not that bad. Added it back.
Co-authored-by: João Dionísio <57299939+Joao-Dionisio@users.noreply.github.com>
|
I'm moving the |
|
@DominikKamp @mmghannam I'm in the middle of reviewing this. Would you mind just letting me know if you have any high-level observations? |
|
@Opt-Mucca if you don't mind, can you also give your high-level opinion on this, please? 🙏 |
|
@Joao-Dionisio The changes look good! The naming scheme makes sense. I've got no high-level critiques (or even low-level ones). It also starts the move away from one mega file. Is there a plan to package exact solving capabilities into the standard PyPI distribution? |
|
Thank you @Opt-Mucca !
Yep, it's a WIP in scipoptsuite-deploy#46, along with SCIP in debug mode. Still not finished though! |
# Conflicts: # src/pyscipopt/scip.pxi # src/pyscipopt/scip.pyi
… members, add changelog entries
|
@DominikKamp is there something else you're concerned with or do you think that this can be merged? |
…te/read to BaseModel, fix deprecation stacklevel and version
…butes in ExactModel's AttributeError
… ExactModel in create/from_ptr
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1292 +/- ##
==========================================
- Coverage 58.15% 57.43% -0.72%
==========================================
Files 27 30 +3
Lines 6012 6120 +108
==========================================
+ Hits 3496 3515 +19
- Misses 2516 2605 +89 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The main concerns lie in exact handling, which is separated for some reason. We will only see what is missing after adding |
|
It is separated because I prefer to make one humungous change at a time. This is a big rewrite also for normal models, where a little slip could spell doom, in theory. But it seems that nothing pops up, so I will merge in some time. |
Co-authored-by: João Dionísio <57299939+Joao-Dionisio@users.noreply.github.com>
|
Alright everyone, thank you for taking a look! Let's see how much stuff we end up breaking by merging this 😄 |
|
@jonathanberthias @Zeroto521 @adamj34 tagging you guys because this is a pretty big change and you regularly contribute. If you're able, please update your PySCIPOpt's to include this change and let me know if something unexpected is happening. |
We want to introduce proper exact solving capabilities with the next major release. For this, we decided it would be best to have 3 distinct classes. A
BaseModelclass that holds the methods that are common to both types of solving. AModelclass that has the non-exact methods. AnExactModelclass that has the exact methods. This way, we have the best of both worlds, as most users will not experience any difference at all, they will justfrom pyscipopt import Model, and users of exact-SCIP can instead dofrom pyscipopt import ExactModel, and work with an exact model as they would a non-exact model. We decided to do things like this because we are able to not leak dangerous methods into the exact model.This PR does the most difficult part of the work, the splitting of
ModelandBaseModel. I'm creatingmodel.pxi,basemodel.pxi,exactmodel.pxi.scip.pxiwould just have SCIP's base classes, but this can still be changed, of course.