Closed
Description
With pint 0.24, the formatting machinery changed a lot. In 0.24.0 our formatter broke because we couldn't re-create Unit object, the registry was None (see hgrecco/pint#2009), this was fixed, but another bugfix broke the specific case of a dimensionless variable, see hgrecco/pint#2024.
MWE with cf-xarray
from cf_xarray import units
u = units.units.parse_units("")
f"{u:cf}"
raises the error shown in the pint issue.