jump-dev / Convex.jl

A Julia package for disciplined convex programming
https://jump.dev/Convex.jl/stable/
Other
559 stars 119 forks source link

Should GenericConstraint constrain the sets? #630

Closed ericphanson closed 2 months ago

ericphanson commented 2 months ago

It seems each one needs a definition of vexity and head, so plugging an arbitrary set in will give confusing errors to users. Maybe we can check this and give a nicer error? Maybe an allowlist or to be more extensible, we could use hasmethod to try to detect if the set is supported?

blegat commented 2 months ago

I'd just add a default method for vexity(::Vexity, ::MOI.AbstractSet) that throws a nice error