assertExpressionsEqual

(function from pyomo.core.expr.compare)

pyomo.core.expr.compare.assertExpressionsEqual(test, a, b, include_named_exprs=True, places=None)[source]

unittest-based assertion for comparing expressions

This converts the expressions a and b into prefix notation and then compares the resulting lists.

Parameters:
  • test (unittest.TestCase) – The unittest TestCase class that is performing the test.

  • a (ExpressionBase or native type)

  • b (ExpressionBase or native type)

  • include_named_exprs (bool) – If True (the default), the comparison expands all named expressions when generating the prefix notation

  • places (int) – Number of decimal places required for equality of floating point numbers in the expression. If None (the default), the expressions must be exactly equal.