unyt
unyt copied to clipboard
unit registry diet
Currently Unit objects can carry a copy of a full UnitRegistry object. This is wasteful, since the Unit Object only needs to keep track of other unit names with the same dimensions to compute conversion factors. In addition, the units in the global default_unit_registry don't need to be stored in every UnitRegistry instance, since it shouldn't be possible to mutate the values of any real-world physical units.
A good benchmark here would be the size of a pickle of a Unit object.