Skip to content

Default format of dimensionless Unit: undocumented change in 0.24 #2007

@khaeru

Description

@khaeru

Consider the following:

import pint

q = pint.Quantity(1.0, "")
print(f"{q.units}")

With pint 0.23:

  • The output is 'dimensionless'.
  • With instead f"{q.units:D}", the output is 'dimensionless'.
  • With instead f"{q.units:~}", the output is ''.

With pint 0.24:

This change is not mentioned in the change log, and there was not a PendingDeprecationWarning or FutureWarning to indicate this behaviour would change with 0.24.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions