I think you want to use ``u.dimensionless`` instead of ``Unit('dimensionless')``, because the `Unit` constructor is relatively slow - I measure a roughly 200x speedup (at least for just this line).  And it's the same object either way  (``u.dimensionless is u.Unit('dimensionless')`` is True)

Similarly for all the places below that have ``Unit('dimensionless')``