Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parametrize GenericModel with objective/variable sub-model #1521

Merged
merged 7 commits into from
Aug 11, 2021

Conversation

blegat
Copy link
Member

@blegat blegat commented Aug 10, 2021

Closes #1261
Closes #1502
Closes #1470

@odow
Copy link
Member

odow commented Aug 10, 2021

Not sure why ci didn't start?

Ah actions are down: https://www.githubstatus.com

@odow odow closed this Aug 10, 2021
@odow odow reopened this Aug 10, 2021
Copy link
Member

@odow odow left a comment

Choose a reason for hiding this comment

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

See the test failures.

@odow
Copy link
Member

odow commented Aug 11, 2021

Actually I should be able to handle this.

@odow
Copy link
Member

odow commented Aug 11, 2021

That type printing is now pretty terrible...

@blegat
Copy link
Member Author

blegat commented Aug 11, 2021

That type printing is now pretty terrible...

It shouldn't be an issue thanks to JuliaLang/julia#36107.
It's not visible in the docs since it's using Julia v1.0. We probably also need to export Model for it to work :/

@blegat
Copy link
Member Author

blegat commented Aug 11, 2021

With the added export, you now have on Julia v1.6:

julia> Model
ERROR: UndefVarError: Model not defined
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base ./Base.jl:26
 [2] top-level scope
   @ REPL[3]:1
julia> Base.show(IOContext(stdout, :compact => true), MathOptInterface.Utilities.Model)
Model{T} where T
julia> Base.show(MathOptInterface.Utilities.Model)
MathOptInterface.Utilities.Model{T} where T
julia> print(MathOptInterface.Utilities.Model)
MathOptInterface.Utilities.Model{T} where T
julia> MathOptInterface.Utilities.Model
MathOptInterface.Utilities.Model{T} where T (alias for MathOptInterface.Utilities.GenericModel{T, MathOptInterface.Utilities.ObjectiveFunctionContainer{T}, MathOptInterface.Utilities.SingleVariableConstraints{T}, MathOptInterface.Utilities.ModelFunctionConstraints{T}} where T)

julia> using MathOptInterface.Utilities

julia> Model
Model{T} where T (alias for MathOptInterface.Utilities.GenericModel{T, MathOptInterface.Utilities.ObjectiveFunctionContainer{T}, MathOptInterface.Utilities.SingleVariableConstraints{T}, MathOptInterface.Utilities.ModelFunctionConstraints{T}} where T)

@odow
Copy link
Member

odow commented Aug 11, 2021

My main issue is that it's going to cause issues with JuMP's printing of a model. Perhaps we could modify the printing on the JuMP-side though.

@odow odow merged commit 9e79136 into master Aug 11, 2021
@odow odow deleted the bl/versatile_model branch August 11, 2021 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants