pystencils.AssignmentCollection.new_with_substitutions#
- AssignmentCollection.new_with_substitutions(substitutions, add_substitutions_as_subexpressions=False, substitute_on_lhs=True, sort_topologically=True)#
Returns new object, where terms are substituted according to the passed substitution dict.
- Parameters:
substitutions (
Dict
) – dict that is passed to sympy subs, substitutions are done main assignments and subexpressionsadd_substitutions_as_subexpressions (
bool
) – if True, the substitutions are added as assignments to subexpressionssubstitute_on_lhs (
bool
) – if False, the substitutions are done only on the right hand side of assignmentssort_topologically (
bool
) – if subexpressions are added as substitutions and this parameters is true, the subexpressions are sorted topologically after insertion
- Return type:
- Returns:
New AssignmentCollection where substitutions have been applied, self is not altered.