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
ApproximateRateor as the original / underlying rate inModifiedRateorBranchedRateare not included.Note
The method
RateCollection.get_ratesreturns 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 ofApproximateRate,ModifiedRate, orBranchedRate).The rates that are hidden, and therefore do not appear in
RateCollection.ratesare identified byRateCollection._classify_hidden_rate, and they are given theRate.removed = Trueattribute.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.ratescan be obtained viaRateCollection.get_hidden_rates.type-specific lists (
reaclib_rates,starlib_rates,tabular_rates, …): these contain just the rates of a particular type orRatesubclass. They are sorted into these lists byRateCollection._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:
custom rates (in python only)
Important
From this ordering, it is clear that only an ApproximateRate can depend on
a DerivedRate.