Skip to content
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

Enable commercial solver use without modifying GenX source code #531

Merged
merged 24 commits into from
Nov 9, 2023

Conversation

gmantegna
Copy link
Collaborator

@gmantegna gmantegna commented Aug 21, 2023

Description

This PR enables users to use a commercial solver without modifying the GenX source code, by adding an optimizer object as an argument to run_genx_case. This will both eliminate the significant annoyance for developers who use Gurobi of needing to update the GenX environment and module every time they pull code changes, and make it possible for users that are simply installing GenX as a package (without the ability to modify the source code) to use solvers that are not HiGHS. It also conforms with best practices suggested by the developers of JuMP (see jump-dev/Gurobi.jl#517).

A couple of notes:

  • Despite the new argument to run_genx_case, backward compatibility is maintained when using the HiGHS solver, as the optimizer object is an optional argument with HiGHS as a default.
  • Users using non-HiGHS solvers will need to update their Run.jl files with this code change. However, they have to update the GenX source code anyways when pulling new changes so I do not anticipate this being a barrier.
  • The type for the optimizer object is currently set to Any, which JuMP developers have confirmed is the proper type to set.

What type of PR is this? (check all applicable)

  • Feature
  • Bug Fix
  • Documentation Update
  • Code Refactor
  • Performance Improvements

Related Tickets & Documents

jump-dev/Gurobi.jl#517

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and .md files under /docs/src have been updated if necessary.
  • [] The latest changes on the target branch have been incorporated, so that any conflicts are taken care of before merging. This can be accomplished either by merging in the target branch (e.g. 'git merge develop') or by rebasing on top of the target branch (e.g. 'git rebase develop'). Please do not hesitate to reach out to the GenX development team if you need help with this.
  • Code has been tested to ensure all functionality works as intended.
  • CHANGELOG.md has been updated (if this is a 'notable' change).
  • I consent to the release of this PR's code under the GNU General Public license.

How this can be tested

Can test using the SmallNewEngland/OneZone_Gurobi test case.

Post-approval checklist for GenX core developers

After the PR is approved

  • Check that the latest changes on the target branch are incorporated, either via merge or rebase
  • Remember to squash and merge if incorporating into develop

@gmantegna gmantegna changed the base branch from main to develop August 21, 2023 17:42
src/GenX.jl Outdated Show resolved Hide resolved
@gmantegna
Copy link
Collaborator Author

gmantegna commented Aug 21, 2023 via email

@cfe316
Copy link
Collaborator

cfe316 commented Aug 31, 2023

Here were some comments from the group discussion today. I think the sentiment was positive.

  • Please update the documentation to reflect how to use this.
    • Emphasize that Highs is the default
  • Add to the changelog.
  • Make the example simpler: currently it's an 8760 example; make it an even-more-minimal commerical-solver example. Perhaps 24 hours, as few generators and policies as possible etc.
  • No need for any solver.yml files other than gurobi (or maybe gurobi + cplex + highs)

Copy link
Collaborator

@cfe316 cfe316 left a comment

Choose a reason for hiding this comment

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

This will be really excellent, and a key step for making GenX into a proper package.

  • please add to the changelog
  • My main recommendation is to chop down the example to something like 24 hours.
  • Remove all solver settings other than highs/gurobi/cplex
  • suggest calling the example ProprietarySolver or CommercialSolver rather than OneZone_Gurobi
  • alter its README to stress what this example is about; forget the generic SmallNewEngland instructions

Copy link
Collaborator

@cfe316 cfe316 left a comment

Choose a reason for hiding this comment

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

Please see requested changes about - then let's pull it in!

@cfe316
Copy link
Collaborator

cfe316 commented Oct 31, 2023

@lbonaldo This PR needs to be rebased on the latest develop.
Load_data.csv in the example will need to be changed to Demand_data.csv.

Copy link
Collaborator

@cfe316 cfe316 left a comment

Choose a reason for hiding this comment

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

I believe all changes are in order. @lbonaldo any reason we can't merge this?

@lbonaldo
Copy link
Collaborator

lbonaldo commented Nov 8, 2023

No, everything looks ready. We will have a final review tomorrow and then merge it.

@lbonaldo lbonaldo merged commit 1f37452 into GenXProject:develop Nov 9, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants