Working with Network Objects#

Rate lists#

At its core, a RateCollection holds a list of Rate objects, and uses these to determine everything about the network.

These are the most important:

  • RateCollection.rates : this is the list of all of the rates in the network that explicitly link together nuclei in the network.

    This means that rates that are only used as part of rate approximations in ApproximateRate or as the original / underlying rate in ModifiedRate or BranchedRate are not included.

    Note

    The method RateCollection.get_rates returns this list.

  • RateCollection.all_rates : this is the list of every rate that will be evaluated when integrating the network, including those that are hidden (i.e., part of ApproximateRate, ModifiedRate, or BranchedRate).

    The rates that are hidden, and therefore do not appear in RateCollection.rates are identified by RateCollection._classify_hidden_rate, and they are given the Rate.removed = True attribute.

    It is always the case that:

    len(all_rates) >= len(rates)
    

    Note

    The list of rates that are hidden, and therefore not contained in RateCollection.rates can be obtained via RateCollection.get_hidden_rates.

  • type-specific lists (reaclib_rates, starlib_rates, tabular_rates, …): these contain just the rates of a particular type or Rate subclass. They are sorted into these lists by RateCollection._build_collection().

Updating the network meta-data#

Anytime rates are added, nuclei are added, or other fundamental changes are done to the network, we need to rerun RateCollection._build_collection to update all of the meta-data.

Most functions already handle this themselves.

Ordering in which we fill rates#

In the righthand side function that is output by the different backends, we evaluate the rates in the following order:

Important

From this ordering, it is clear that only an ApproximateRate can depend on a DerivedRate.