Skip to content

refac: replace print calls with str-returning format_* methods#621

Open
FBumann wants to merge 3 commits intomasterfrom
format-labels-deprecate-print
Open

refac: replace print calls with str-returning format_* methods#621
FBumann wants to merge 3 commits intomasterfrom
format-labels-deprecate-print

Conversation

@FBumann
Copy link
Collaborator

@FBumann FBumann commented Mar 14, 2026

Summary

  • Add format_labels() on Constraints and Variables that return strings instead of printing to stdout
  • Add format_infeasibilities() on Model that returns a string representation of infeasible constraints
  • Deprecate print_labels() and print_infeasibilities() with DeprecationWarning pointing to the new methods

Closes #476

Test plan

  • Existing tests pass (387 passed)
  • Linting passes (ruff check)
  • Pre-commit hooks pass

🤖 Generated with Claude Code

FBumann and others added 3 commits March 14, 2026 22:38
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>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@FBumann FBumann requested a review from lkstrp March 14, 2026 21:44
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.

Better logging of print calls

1 participant