Conversation
1. linopy/matrices.py:185-238 - Uniqueness check for QC labels Added seen_labels tracking in both qc_sense and qc_rhs properties with assertions to detect duplicate quadratic constraint labels across different constraint objects. 2. linopy/matrices.py:241-305 - Document Q-matrix assembly assumptions Extended the docstring for Qc property to document the assumption that flat_qcons stores each quadratic term exactly once, and the symmetrization logic applied. 3. linopy/matrices.py:307-357 - Debug assertions for label consistency Added a skipped_rows counter in qc_linear with an assertion that fails if any linear terms are skipped due to missing variable or constraint labels. 4. linopy/constants.py:203-213 - Expose qc_dual in Result repr Updated Result.__repr__ to show the count of qc_duals when present (e.g., "Solution: 2 primals, 1 duals, 3 qc_duals"). 5. examples/quadratic-constraints.ipynb - Strip notebook outputs Cleared all execution outputs and reset execution counts to None for all code cells. 6. linopy/io.py:462-470 - Guard for missing label metadata Added an explicit check with a clear ValueError if a label from the flat representation is not found in the constraint metadata. Also fixed: - linopy/solvers.py:1213 - Removed the double assignment typo (solution = solution = ...).
|
Caution Review failedThe pull request is closed. WalkthroughThis PR enhances quadratic constraint handling through validation additions, testing infrastructure improvements, and bug fixes. It includes duplicate QC label validation, Solution representation updates, file export enhancements, MOSEK convention alignment, and a comprehensive test suite for multi-solver QC solving. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes # (if applicable).
Changes proposed in this Pull Request
Checklist
doc.doc/release_notes.rstof the upcoming release is included.Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.