Skip to content

CF unit formatter incompatible with latest pint #522

Closed
@aulemahal

Description

@aulemahal

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopinion wantedUser input requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions