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

add COPT solver #190

Merged
merged 4 commits into from
Oct 31, 2023
Merged

add COPT solver #190

merged 4 commits into from
Oct 31, 2023

Conversation

fneum
Copy link
Member

@fneum fneum commented Oct 28, 2023

closes #186

https://shanshu.ai/copt

Documentation: https://guide.coap.online/copt/en-doc/index.html

Install with pip install coptpy

Commercial, free academic license.

Tested locally and passed all tests. However, quadratic problems are not supported yet (LP file format issues?).

Small problem instances do not require a license. Hence, this solver can be tested in CI.

COPT could also calculate IIS (for later).

import pypsa

n = pypsa.examples.ac_dc_meshed()
n.optimize(solver_name='highs')
n.buses_t.marginal_price["London"]
n.generators_t.p
n.optimize(solver_name='copt', solver_options=dict(LpMethod=2))
n.generators_t.p
n.buses_t.marginal_price["London"]

@codecov
Copy link

codecov bot commented Oct 28, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (c1186a3) 89.22% compared to head (0557525) 89.25%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #190      +/-   ##
==========================================
+ Coverage   89.22%   89.25%   +0.03%     
==========================================
  Files          15       15              
  Lines        3136     3182      +46     
  Branches      723      731       +8     
==========================================
+ Hits         2798     2840      +42     
- Misses        234      237       +3     
- Partials      104      105       +1     
Files Coverage Δ
linopy/solvers.py 90.10% <91.30%> (+0.16%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fneum fneum changed the title add COPT solver (skeleton) add COPT solver Oct 29, 2023
@fneum fneum marked this pull request as ready for review October 29, 2023 19:35
@fneum fneum requested a review from FabianHofmann October 29, 2023 19:45
@FabianHofmann
Copy link
Collaborator

Wow, super nice! I hope I can review soon, but it looks very good on the first glimpse (same for #189, #188 )

@FabianHofmann FabianHofmann merged commit b91f08d into master Oct 31, 2023
12 checks passed
@loongmxbt
Copy link

loongmxbt commented Nov 23, 2023

Hi, copt also support quadratic problem, hope to add to quadratic solvers option.

ValueError: Solver copt does not support quadratic problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support COPT
3 participants