Skip to content

Commit a697c28

Browse files
committed
Better error message when convexity/concavity isn't specified
1 parent 149b68e commit a697c28

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

pyomo/contrib/piecewise/transform/epigraph_hypograph.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ def _transform_pw_linear_expr(self, pw_expr, pw_linear_func, transformation_bloc
4343
epigraph = False
4444
if pw_linear_func.convex is None:
4545
# we should autodetect if the dimension isn't insane, yell otherwise
46-
raise NotImplementedError("Convexity not specified")
46+
raise NotImplementedError(
47+
"It is (quadratically, in the number of pieces) possible to "
48+
"auto-detect if a piecewise-linear "
49+
"function is convex or concave, but we don't currently have an "
50+
"implementation. PRs are welcome, or manually specify in the "
51+
"PiecewiseLinearFunction constructor the convexity/concavity "
52+
"using the 'convex' argument."
53+
)
4754
if pw_linear_func.convex:
4855
# This will be epigraph
4956
epigraph = True

0 commit comments

Comments
 (0)