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

avoid using highs_bindings, they are not needed and are removed in 1.7.1.dev #264

Merged

Conversation

apfelix
Copy link
Contributor

@apfelix apfelix commented Apr 4, 2024

Mini change to get ObjSense.kMaximize directly from highspy instead of highspy.highs_bindings.

This will make linopy compatible with the dev version 1.7.1.dev1 of highspy, while keeping it compatible with the current stable version 1.5.3.

However, when running the tests, I noticed that all .mps tests fail for test/test_optimization.py::test_model_maximization, as the .mps file generated with 1.7.1.dev1 no longer flips the objective coefficients, but instead uses OBJSENSE MAX.

1.5.3 file:

NAME        
ROWS
 N  Obj     
 L  c0      
 L  c1      
COLUMNS
    x0        Obj       -1
    x0        c0        2
    x0        c1        4
    x1        Obj       -2
    x1        c0        6
    x1        c1        2
RHS
    RHS_V     c0        10
    RHS_V     c1        3
BOUNDS
 FR BOUND     x0      
 FR BOUND     x1      
ENDATA

1.7.1.dev1 file:

NAME        
OBJSENSE
  MAX
ROWS
 N  Obj     
 L  c0      
 L  c1      
COLUMNS
    x0        Obj       1
    x0        c0        2
    x0        c1        4
    x1        Obj       2
    x1        c0        6
    x1        c1        2
RHS
    RHS_V     c0        10
    RHS_V     c1        3
BOUNDS
 FR BOUND     x0      
 FR BOUND     x1      
ENDATA

As 1.7.1.dev1 is no stable version, I didn't adjust the code for this change.

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.78%. Comparing base (ecbc962) to head (b5f40dc).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #264      +/-   ##
==========================================
- Coverage   88.94%   85.78%   -3.16%     
==========================================
  Files          15       15              
  Lines        3645     3645              
  Branches      856      856              
==========================================
- Hits         3242     3127     -115     
- Misses        279      403     +124     
+ Partials      124      115       -9     

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

@FabianHofmann
Copy link
Collaborator

@apfelix great that you look into this. Let's merge it and fix the other issue as soon as the stable version is out.

@FabianHofmann FabianHofmann merged commit 3c11dc5 into PyPSA:master Apr 4, 2024
11 of 12 checks passed
@apfelix apfelix deleted the fh/fix_highs_171_dev_version branch May 16, 2024 12:29
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.

2 participants