Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
khaeru opened this issue Jun 10, 2024 · 2 comments · Fixed by #2012
Closed

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

khaeru opened this issue Jun 10, 2024 · 2 comments · Fixed by #2012

Comments

@khaeru
Copy link
Contributor

khaeru commented Jun 10, 2024

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.

@andrewgsavage
Copy link
Collaborator

@hgrecco would it be worth releasing a 0.24.1 formats dimensionless as dimensionless for these format specs?

@hgrecco
Copy link
Owner

hgrecco commented Jun 11, 2024

Yes! And also to address #2009

khaeru added a commit to iiasa/ixmp that referenced this issue Jun 17, 2024
khaeru added a commit to iiasa/ixmp that referenced this issue Jun 17, 2024
khaeru added a commit to iiasa/ixmp that referenced this issue Jun 17, 2024
khaeru added a commit to iiasa/ixmp that referenced this issue Jun 17, 2024
khaeru added a commit to iiasa/message-ix-models that referenced this issue Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants