You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refac: replace print calls with str-returning format_* methods (#621)
* refac: replace print calls with str-returning format_* methods
Add format_labels (Constraints, Variables) and format_infeasibilities
(Model) that return strings instead of printing to stdout. Deprecate
the old print_labels and print_infeasibilities methods with warnings
pointing callers to the new alternatives.
Closes#476
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: add release note for format_labels/format_infeasibilities
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: note global options default for display_max_terms
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refac: rename print_single_constraint to format_single_constraint
Align internal helper naming with the format_* convention introduced
for the public API methods.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refac: rename remaining print_* helpers to format_*
Rename print_coord, print_single_variable, print_single_expression,
and print_line to use the format_* naming convention consistently.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Fabian Hofmann <fab.hof@gmx.de>
Copy file name to clipboardExpand all lines: doc/release_notes.rst
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ Upcoming Version
24
24
* Improve handling of CPLEX solver quality attributes to ensure metrics such are extracted correctly when available.
25
25
* Fix Xpress IIS label mapping for masked constraints and add a regression test for matching infeasible coordinates.
26
26
* Enable quadratic problems with SCIP on windows.
27
+
* Add ``format_labels()`` on ``Constraints``/``Variables`` and ``format_infeasibilities()`` on ``Model`` that return strings instead of printing to stdout, allowing usage with logging, storage, or custom output handling. Deprecate ``print_labels()`` and ``print_infeasibilities()``.
27
28
* Add ``fix()``, ``unfix()``, and ``fixed`` to ``Variable`` and ``Variables`` for fixing variables to values via equality constraints. Supports automatic rounding for integer/binary variables.
28
29
* Add ``relax()``, ``unrelax()``, and ``relaxed`` to ``Variable`` and ``Variables`` for LP relaxation of integer/binary variables. Supports partial relaxation via filtered views (e.g. ``m.variables.integers.relax()``). Semi-continuous variables raise ``NotImplementedError``.
0 commit comments