8000 Add `filter_constraints` kwarg to `copy_model(::InfiniteModel)` by dnguyen227 · Pull Request #432 · infiniteopt/InfiniteOpt.jl · GitHub
[go: up one dir, main page]

Skip to content

Add filter_constraints kwarg to copy_model(::InfiniteModel) - #432

Merged
pulsipher merged 5 commits into
infiniteopt:masterfrom
dnguyen227:filter_constraints
May 25, 2026
Merged

pulsipher merged 5 commits into
infiniteopt:masterfrom
dnguyen227:filter_constraints

Conversation

@dnguyen227
Copy link
Copy Markdown
Member

Adds a filter_constraints::Union{Nothing, Function} keyword to JuMP.copy_model(::InfiniteModel). When supplied, any source constraint for which filter_constraints(cref) returns false is skipped at copy time, and obj_dict entries pointing at uncopied refs (or containers with any uncopied element) are dropped so the copy carries no dangling references. Default nothing preserves current behavior.

This closes #430,

@codecov
codecov Bot commented May 25, 2026 •
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.77%. Comparing base (724d56f) to head (a4a4547).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #432   +/-   ##
=======================================
  Coverage   99.77%   99.77%           
=======================================
  Files          39       39           
  Lines        6791     6797    +6     
=======================================
+ Hits         6776     6782    +6     
  Misses         15       15           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dnguyen227
Copy link
Copy Markdown
Member Author

@pulsipher Ready for review!

@pulsipher pulsipher left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pulsipher
pulsipher merged commit e6ca536 into infiniteopt:master May 25, 2026
9 checks passed
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.

[FEATURE] Add 'filter_constraints' keyword to 'JuMP.copy_model(::InfiniteModel)'

2 participants

0