feat: Add indicator constraints#594
Open
mcoughlin wants to merge 18 commits into
Open
Conversation
2 tasks
Collaborator
|
@mcoughlin I am sorry this takes so long. there is a big refactoring going on in #630 which interferes a little with this. I hope you don't mind us taking a little longer |
Contributor
Author
|
@FabianHofmann No rush take your time! |
1 task
…traints # Conflicts: # doc/release_notes.rst # linopy/io.py # linopy/model.py # linopy/solver_capabilities.py
Add is_indicator/binary_var/binary_val to ConstraintBase, Constraint, and CSRConstraint (slots, init, from_mutable, data, netcdf round-trip). Add Constraints.indicator/.regular container accessors.
…odel+common+matrices)
MatrixAccessor.indicator_sense holds single-char senses (<, >, =) from to_matrix_with_rhs; the direct-API sense_map was keyed on two-char strings, raising KeyError on the direct path (LP-file path was fine).
Add freeze round-trip, netCDF round-trip (mutable + frozen), matrix split, copy preservation, and direct-API Gurobi solve coverage.
ncons feeds model.ncons which the Mosek backend uses to size the (regular-only) matrix M.A; keep them aligned. Also exclude indicators from the consolidated to_matrix. Add ncons assertion and release note.
Fold indicator constraints into the unified constraint data model (PyPSA#637)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes # (if applicable).
Changes proposed in this Pull Request
Adding indicator constraints
Checklist
doc.doc/release_notes.rstof the upcoming release is included.