Dualization.jl
                                
                                
                                
                                    Dualization.jl copied to clipboard
                            
                            
                            
                        Thoughts on adding to MOI
What are the pros and cons of adding this as a submodule to MOI?
Pros
- Fewer packages to install when users need to use these features.
 - Might be easier to maintain as more people actively watch MOI.
 - Opportunity to rethink some decisions and be able to solve #27.
 - Have deeper discussions about how to export KKT conditions.
 
Cons
- Might need a little bit of refactoring, at least eliminate the JuMP dependent parts.
 - Can break dependent packages (BilevelJuMP and MaxminOPF) Should not be hard to solve.
 - Lose all the tests that rely on solvers
 
at least eliminate the JuMP dependent parts.
Are these the only JuMP parts? https://github.com/jump-dev/Dualization.jl/blob/3a8bb08dcd1b21e91881bea205dac46290c2a7fa/src/dualize.jl#L68-L88
If so, it should be easy to move the MOI parts to MOI, and add these two functions to JuMP.
Lose all the tests that rely on solvers
This seems like a blocker, but couldn't we just write out the dual problems to a file and compare against stored solutions?
I think they are, very little indeed.
Yes, we can! Losing all tests that rely on solvers requires being more careful when adding new tests but it is not extremely necessary.
For me we can add it to MOI, maybe others have cons that I am not seeing.
I agree it could be moved to MOI at some point. It could allow adding a dualize keyword argument to JuMP (even if we could also add Dualization as a JuMP dependency).
We should have as conditions for MOI conditions to be merged in MOI that they are mature enough and have tests not relying on solvers so I would say these are blocking:
- [ ] https://github.com/JuliaOpt/Dualization.jl/issues/9
 - [x] https://github.com/JuliaOpt/Dualization.jl/issues/27
 - [ ] Rewrite test with 
MockOptimizer - [ ] Not rely on an inner layer of bridge and use an outer one instead to fix (https://github.com/jump-dev/Dualization.jl/issues/73) https://github.com/jump-dev/Dualization.jl/blob/3a8bb08dcd1b21e91881bea205dac46290c2a7fa/src/MOI_wrapper.jl#L43
 
con is that we keep pushing new things onto MOI itself. Keeping lighter packages within the JuMP-dev org seems easier to improve upon and less overwhelming for users.
even if we could also add Dualization as a JuMP dependency
I would favour such solution, make JuMP a all-at-once bundle but keep MOI lighter