modelparameters.sympy.strategies.branch package

Submodules

modelparameters.sympy.strategies.branch.core module

Generic SymPy-Independent Strategies

modelparameters.sympy.strategies.branch.core.chain(*brules)[source]

Compose a sequence of brules so that they apply to the expr sequentially

modelparameters.sympy.strategies.branch.core.condition(cond, brule)[source]

Only apply branching rule if condition is true

modelparameters.sympy.strategies.branch.core.debug(brule, file=None)[source]

Print the input and output expressions at each rule application

modelparameters.sympy.strategies.branch.core.do_one(*brules)[source]

Execute one of the branching rules

modelparameters.sympy.strategies.branch.core.exhaust(brule)[source]

Apply a branching rule repeatedly until it has no effect

modelparameters.sympy.strategies.branch.core.identity(x)[source]
modelparameters.sympy.strategies.branch.core.multiplex(*brules)[source]

Multiplex many branching rules into one

modelparameters.sympy.strategies.branch.core.notempty(brule)[source]
modelparameters.sympy.strategies.branch.core.onaction(brule, fn)[source]
modelparameters.sympy.strategies.branch.core.sfilter(pred, brule)[source]

Yield only those results which satisfy the predicate

modelparameters.sympy.strategies.branch.core.yieldify(rl)[source]

Turn a rule into a branching rule

modelparameters.sympy.strategies.branch.tools module

modelparameters.sympy.strategies.branch.tools.canon(*rules)[source]

Strategy for canonicalization

Apply each branching rule in a top-down fashion through the tree. Multiplex through all branching rule traversals Keep doing this until there is no change.

modelparameters.sympy.strategies.branch.traverse module

Branching Strategies to Traverse a Tree

modelparameters.sympy.strategies.branch.traverse.sall(brule, fns={'children': <function <lambda>>, 'leaf': <function <lambda>>, 'new': <function Basic.__new__>, 'op': <class 'type'>})[source]

Strategic all - apply rule to args

modelparameters.sympy.strategies.branch.traverse.top_down(brule, fns={'children': <function <lambda>>, 'leaf': <function <lambda>>, 'new': <function Basic.__new__>, 'op': <class 'type'>})[source]

Apply a rule down a tree running it on the top nodes first

Module contents