sfepy.base.resolve_deps module

Functions for resolving dependencies.

sfepy.base.resolve_deps.get_nums(deps)[source]

Get number of prerequisite names for each name in dependencies.

sfepy.base.resolve_deps.remove_known(deps, known)[source]

Remove known names from dependencies.

sfepy.base.resolve_deps.resolve(deps)[source]

Resolve dependencies among equations so that smaller blocks are solved first.

The dependencies are given in terms of variable names.

Parameters:

deps : dict

The dependencies as a dictionary with names as keys and sets of prerequisite names as values.

Returns:

order : list

The list of blocks in the order of solving. Each block is a list of names.

sfepy.base.resolve_deps.solvable(deps, names)[source]

Return True if names form a solvable block, i.e. the set of names equals to the set of their prerequisites.

sfepy.base.resolve_deps.try_block(deps, num)[source]

Return generator of lists of solvable blocks of the length num.