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

Type piracy #19

Closed
odow opened this issue Sep 3, 2023 · 2 comments
Closed

Type piracy #19

odow opened this issue Sep 3, 2023 · 2 comments

Comments

@odow
Copy link
Contributor

odow commented Sep 3, 2023

This method is type piracy:

UnitJuMP.jl/src/units.jl

Lines 178 to 181 in c55366f

function JuMP.moi_function(func::AbstractVector{<:AbstractJuMPScalar})
func = [expr(f) for f in func]
return JuMP.moi_function(func)
end

The tests fail with JuMP#master because we now return a VectorNonlinearFunction instead of hitting this method.

I don't know what a good solution is. Perhaps we just don't support multi-objective problems with UnitJuMP for now?

@trulsf
Copy link
Owner

trulsf commented Sep 4, 2023

The type piracy arised when trying to support multiobjective optmization combining objectives with and without units. My suggestion is to support only multiobjective optimization when all objectives have units. This should not be too much of a restriction. See pull request #20

@trulsf
Copy link
Owner

trulsf commented Sep 4, 2023

Fixed in version 0.2.2

@trulsf trulsf closed this as completed Sep 4, 2023
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

No branches or pull requests

2 participants