Skip to content

[BREAKING] Clean up API for create inner model#209

Draft
blegat wants to merge 3 commits intomasterfrom
bl/cache
Draft

[BREAKING] Clean up API for create inner model#209
blegat wants to merge 3 commits intomasterfrom
bl/cache

Conversation

@blegat
Copy link
Member

@blegat blegat commented Mar 16, 2026

It's a bit counter intuitive to still add caches and bridges when the user explicitly give an instantiated model. I guess the use case is the DualizableModel but maybe we don't need this. We're using a UniversalFallback on top of it anyway so what's the use for it instead of just MOI.Utilities.Model ?

@blegat blegat marked this pull request as draft March 16, 2026 13:59
@blegat blegat changed the title Clean up API for create inner model [BREAKING] Clean up API for create inner model Mar 18, 2026
@blegat
Copy link
Member Author

blegat commented Mar 18, 2026

This is consistent with ParametricOptInterface which does some magic if it takes an optimizer constructor as argument but when it takes an instantiated optimizer, it does not modify it.

@joaquimg
Copy link
Member

Interesting,
Should we document this pattern in MOI docs?

@blegat
Copy link
Member Author

blegat commented Mar 19, 2026

Interesting, Should we document this pattern in MOI docs?

Yes, I think we should discuss this, and it should also go in parallel with the layer design that @odow suggested in
jump-dev/JuMP.jl#4014 (comment)
In the meantime, we can try to see if we can simplify the logic of each layer. For POI, we could improve MatrixOfConstraints to get rid of
https://github.com/jump-dev/ParametricOptInterface.jl/blob/2219828f43a81268a3c0b4bc787b1ea48a9e768f/src/ParametricOptInterface.jl#L304-L317

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants