Ticket #4252 (new minor enhancement)

Opened 7 years ago

Last modified 7 years ago

Add constraint rule warnings

Reported by: wehart Owned by: unassigned
Priority: minor Milestone: Pyomo 4.x
Component: pyomo.core Version:
Keywords: Cc:


Add a warning when a rule returns a non-expression value. I think this should be the default, and it would be suppressed with the -q option.

Is this a good idea? I'm not sure.

Change History

comment:1 Changed 7 years ago by jwatson

I am not a fan of having to explicitly suppress the warning if None is returned. Rather, I would prefer the opposite (lacking a lint-style script) - a flag to generate warning messages of possible issues, which is disabled by default.

comment:2 Changed 7 years ago by jdsiiro

Define "non-expression value"... We have a history of allowing constraint rules to return:

  • an expression (equality, inequality, double inequality)
  • a tuple (2- or 3-value)
  • None

Are you talking about tossing a warning for other values? Should that not be an error? Or are you thinking about tossing a warning for tuple and None?

Note: See TracTickets for help on using tickets.