Optimizing speed
For long sequences with many TRs (>1000), run times are very slow in some cases. One culprit is pint Quantity, specifically when casting between unit types using a string (m_as(), to()).
In general it seems some optimization is necessary at the base level to speed these things up.