Context Managers
-
class
pyomo.core.expr.current.
nonlinear_expression
[source] Context manager for mutable nonlinear sums.
This context manager is used to compute a general nonlinear sum while treating the summation as a mutable object.
Note
The preferred context manager is
mutable_expression
, as the return type will be the most specific ofSumExpression
,LinearExpression
, orNPV_SumExpression
. This context manager will always return aSumExpression
.
-
class
pyomo.core.expr.current.
linear_expression
[source] Context manager for mutable linear sums.
This context manager is used to compute a linear sum while treating the summation as a mutable object.
Note
The preferred context manager is
mutable_expression
.linear_expression
is an alias tomutable_expression
provided for backwards compatibility.
-
class
pyomo.core.expr.current.
clone_counter
[source] DEPRECATED.
Context manager for counting cloning events.
This context manager counts the number of times that theclone_expression
function is executed.Deprecated since version 6.4.3: The clone counter has been removed and will always return 0.
Beginning with Pyomo5 expressions, expression cloning (detangling) no longer occurs automatically within expression generation. As a result, the ‘clone counter’ has lost its utility and is no longer supported. This context manager will always report 0.
-
property
count
A property that returns the clone count value.
-
property