pynucastro.sort_utils module

pynucastro.sort_utils module#

Functions used for sorting rates

exception pynucastro.sort_utils.CircularRateDependency[source]#

Bases: Exception

A circular dependency is detected in a sequence of rates

pynucastro.sort_utils.topo_sort(rates)[source]#

Perform a topological sort on a list of rates.

topo_sort takes a list of Rate objects and does a depth-first search using the child rates as dependencies to produce a topologically-sorted ordering.

Parameters:

rates (Iterable(Rate)) – The collection of rates to sort

Return type:

list(Rate)