-
-
Notifications
You must be signed in to change notification settings - Fork 385
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
Gurobipy Environment Handling #588
Conversation
c892b05
to
72af8a1
Compare
This looks quite cool! What's needed to move this further? A review from @pchtsp? |
Commenting to move this along. Problems with the gurobipy single-use licenses are still unresolved. |
@simon-b I've just added some usage explanations to the doc-string, should be clearer now. |
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.
Looks great to me! Test on my side with various options for managing the gurobi env and all seem to work properly.
Suggest a review from @pchtsp and hopefully can get this closed soon !
prob, self.solver, [const.LpStatusOptimal], {x: 4, y: -1, z: 6, w: 0} | ||
) | ||
if self.solver.name not in [ | ||
"GUROBI_CMD", # end is a key-word for LP files |
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.
Not clear to me why this was changed, when otherwise the PR doesn't seem to make any changes to GUROBI_CMD
🤔
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.
I think this must've not been tested using GUROBI_CMD
. Variable z
is called End
which is a keyword for LP files hence results in the LP file being solved being pretty different
Minimize
9
Subject To
Bounds
End
(I double-checked versions of Gurobi back to 8.0.0 with the same result)
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.
Unless this test is supposed to fail, as the name suggests.
- Add decorator to skip `test_measuring_solving_time` as it exceeds the pip-license size limitations. - Add `test_gurobipy_env` to pulptest which will be skipped if `gurobipy` is not installed.
The tests should now run using the Gurobi license included when installing Unfortunately, the pip license will not be picked up by Therefore the best thing would be to generate and use a Gurobi WLS license that can be added to the workflow via a secret. For now, we can test this by re-running the actions but a maintainer needs to trigger that. |
@torressa we are getting a test fail now, |
Hi @stumitchell! If you mean the tests on the CI, I am not sure why, the errors are:
This is weird cause it passes on macos and also cause highspy doesn't use numpy. I tried removing the warning from the output (I had forgotten quite a few places). |
Right, I see the issue I have contacted @aphi about it We probably want to get master fixed before we merge anything new |
Thanks @stumitchell I was waiting (too) patiently for the numpy issue to resolve in highspy. I did forget to create an issue there : ) so thanks for doing so. I've currently taken out the installation of the highspy python package from the github CI on the master branch. This should solve this issue. @torressa can you re-merge master please? Sorry for the lack of response, these months have been very busy. F. |
Looks like we both investigated this at the same time 😬. I have a PR which keeps the testcase for highspy but just includes numpy, which also resolves the issue. |
No worries @pchtsp! Merged. |
pulp.list_solvers
. Cheers @simonbowly!GUROBI
that allow users more fine control over the environments used.env: gp.Env
users environment to use.envOptions: dict
, options to give to the environment ifmanageEnv
is True.manageEnv: bool
: whether environments are handled internally or not default is false (as it was before).close
. If users are using their own environments or usingmanageEnv=True
, they should always call this function afterwards.Sample use:
Or,