NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1666 most downloaded on PyPI
Physical quantities module
Last release 24 days ago
10 Sep 2026
Release timing varies
gaps range from 8 days to 9 months
Nearly every release is documented
notes for 50 of 54 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
67 releases · first in 2012
Fix UnitRegistry(system="imperial") returning US units instead of imperial ones for shared names like gallon or pint
UnitRegistry(system="imperial") returning US units instead of imperial ones for shared names like gallon or pint (#2408)UnitRegistry's magnitude type parameter a default, so ureg = UnitRegistry() needs no annotation (#2245)Nothing published for this version
Nothing published for this version
One column per quarter.
GenericPlainRegistry.parse_expression now correctly returns a dimensionless Quantity when taking a float, int, or NaN
GenericPlainRegistry.parse_expression now correctly returns a dimensionless Quantity when taking a float, int, or NaN (#2259)Quantity.to_preferred (#2264)^) to format unit with negative exponents (#2256)atomic_unit_of_electric_field_gradient, a_u_efg) (#2269)to_compact() and numpy quantities (#2274)vdot, inner, outer, linalg.outer, matvec, vecmat, tensordot, and linalg.tensordot (#2279)Nothing published for this version
Revert typing change in pint.Unit
pint.UnitNothing published for this version
Fix raising exception in Quantity.from_tuple with invalid units
Quantity.from_tuple with invalid units (#2199)numpy.geomspace (#2206)linalg.diagonal, linalg.matrix_transpose, diag, tril, triu, linalg.eigvals, linalg.eigvalsh, linalg.matrix_norm and linalg.vector_norm (#2210)pint.Quantity being used as Generic. (#2231)nan/nan to return nan rather than 1 in unit conversion (#2228)Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Replace references to the deprecated UnitRegistry.default_format
UnitRegistry.default_format (#2058)Nothing published for this version
Removed deprecated references in documentation and tests (PR #2058, Issue #2057)
‰ symbol (PR #2033, Issue #1963)Fix custom formatter needing the registry object. (PR #2011)
Fix detection of invalid conversion between offset and delta units. (PR #1905)
dim_sort function to _formatter_helpers.dim_order and default_sort_func properties to FullFormatter.
(PR #1926, fixes Issue #1841)get_dimensionality() when non existent units are passed.
(PR #1874, Issue #1716)Nothing published for this version
Add _get_conversion_factor to registry with cache.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Drop Python 3.8 compatability following NEP-29.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Remove deprecated alen numpy function (PR #1678)
atol using np.allclose & np.isclose.
(Issue #1658)alen numpy function
(PR #1678)__dask_postcompute__.
(PR #1722)trapz, dot, and cross to work properly with non-multiplicative units
(Issue #1593)% symbol.
(Issue #1277)Simplify registry subclassing. (Issue #1631)
Reorganized code into facets. Each facet encapsulate a Pint functionality. (See #1466, #1479)
cond and x.
(Issue #1510, #1530)numpy.broadcast_arrays (#1607)cond and x.
(Issue #1510, #1530)Add the separate_format_defaults registry setting (Issue #1501, PR #1503)
separate_format_defaults registry setting (Issue #1501, PR #1503)Provide a method to iter the definitions in the order they appear, recursing the imported files. (Issue #1498)
Deprecate the old format defaulting behavior and prepare for the new one (Issue #1407)
register_unit_format to the formatting docs (Issue #1422).is_compatible_with with registry active contexts (Issue #1424).np.printoptions available since numpy 1.15.numpy.nanprod (Issue #1369)pint.testing with functions to compare pint objects in tests (Issue #1421).to_compact and infer_base_unit for non-float non_int_type.to_reduced_units to work with dimensionless units. (Issue #919)sverdrup (PR #1404)cooling_tower_ton (PR #1484)h. (Issue #719)h with ℎ (U+210E) as default symbol for planck constant.Implement use of Quantity in the Quantity constructor (convert to specified units). (Issue #1231)
Unit.
(Issue #1085)Add the Wh unit for battery capacity measurements (PR #1260, thanks Maciej Grela)
Fix unpickling, now it is using the APP_REGISTRY as expected. (Issue #1175)
Fixed issue where performing an operation of a Quantity with certain units would perform an in-place unit conversion that modified the operand in addi
Change Quantity and Unit HTML (i.e., Jupyter notebook) repr away from LaTeX to a simpler, more performant pretty-text and table based repr inspired by
Quantity and Unit HTML (i.e., Jupyter notebook) repr away from LaTeX to a
simpler, more performant pretty-text and table based repr inspired by Sparse and Dask.
(Issue #654)case_sensitive option to registry for case (in)sensitive handling when parsing
units (Issue #1145)sort option to formatting.formatter to permit disabling sorting of component units in format stringChanges required to support Pint-Pandas 0.1.
Reinstated support for pickle protocol 0 and 1, which is required by pytables (Issue #1036, Thanks Guido Imperiale)
pint-xarray interface library to the docs, next to
the link to pint-pandas. (Thanks Tom Nicholas.)_dir attribute of UnitsRegistry, and added __iter__
method so that now list(ureg) returns a list of all units in registry.
(Issue #1072, Thanks Tom Nicholas)in keyword (Issue #1086)Add full support for Decimal and Fraction at the registry level. BREAKING CHANGE: use_decimal is deprecated. Use non_int_type=Decimal when instantiati…
use_decimal is deprecated. Use non_int_type=Decimal when instantiating
the registry.BREAKING CHANGE: The array protocol fallback deprecated in version 0.10 has been removed. (Issue #1029, Thanks Jon Thielen)
default_en_0.6.txt.__str__ and __format__ locale configurable.
(Issue #984)pyproject.toml for providing setuptools_scm settingsdefault_en_0.6.txtfrom_string method to all Definitions subclasses. The value/converter
argument of the constructor no longer accepts an string.
It is unlikely that this change affects the end user.Fixed bug introduced in 0.10 that prevented creation of size-zero Quantities from NumPy arrays by multiplication. (Issue #977, Thanks Jon Thielen)
BREAKING CHANGE: Boolean value of Quantities with offsets units is ambiguous, and so, now a ValueError is raised when attempting to cast such a Quanti…
BREAKING CHANGE: Boolean value of Quantities with offsets units is ambiguous, and so, now a ValueError is raised when attempting to cast such a Quantity to boolean. (Issue #965, Thanks Jon Thielen)
BREAKING CHANGE:
__array_ufunc__ has been implemented on pint.Unit to permit
multiplication/division by units on the right of ufunc-reliant array types (like
Sparse) with proper respect for the type casting hierarchy. However, until an
upstream issue with NumPy is resolved,
this breaks creation of Masked Array Quantities by multiplication on the right.
Read Pint's NumPy support
documentation for more details.
(Issues #963 and #966, Thanks Jon Thielen)
Documentation on Pint's array type compatibility has been added to the NumPy support page, including a graph of the duck array type casting hierarchy as understood by Pint for N-dimensional arrays. (Issue #963, Thanks Jon Thielen, Stephan Hoyer, and Guido Imperiale)
Improved compatibility for downcast duck array types like Sparse.COO. A collection of basic tests has been added. (Issue #963, Thanks Jon Thielen)
Improvements to wraps and check:
Add revolutions per second (rps)
Improved compatibility for upcast types like xarray's DataArray or Dataset, to which
Pint Quantities now fully defer for arithmetic and NumPy operations. A collection of
basic tests for proper deferral has been added (for full integration tests, see
xarray's test suite). The list of upcast types is available at
pint.compat.upcast_types in the API.
(Issue #959, Thanks Jon Thielen)
Moved docstrings to Numpy Docs (Issue #958)
Added tests for immutability of the magnitude's type under common operations (Issue #957, Thanks Jon Thielen)
Switched test configuration to pytest and added tests of Pint's matplotlib support. (Issue #954, Thanks Jon Thielen)
Deprecate array protocol fallback except where explicitly defined (__array__,
__array_priority__, __array_function__, __array_ufunc__). The fallback will
remain until the next minor version, or if the environment variable
PINT_ARRAY_PROTOCOL_FALLBACK is set to 0.
(Issue #953, Thanks Jon Thielen)
Removed eval usage when creating UnitDefinition and PrefixDefinition from string. (Issue #942)
Added fmt_locale argument to registry.
(Issue #904)
Better error message when Babel is not installed. (Issue #899)
It is now possible to redefine units within a context, and use pint for currency conversions. Read
(Issue #938, Thanks Guido Imperiale)
NaN (any capitalization) in a definitions file is now treated as a number (Issue #938, Thanks Guido Imperiale)
Added slinch to Avoirdupois group (Issue #936, Thanks awcox21)
Fix bug where ureg.disable_contexts() would fail to fully disable throwaway contexts (Issue #932, Thanks Guido Imperiale)
Use black, flake8, and isort on the project (Issues #929, #931, and #937, Thanks Guido Imperiale)
Auto-increase package version at every commit when pint is installed from the git tip, e.g. pip install git+https://github.com/hgrecco/pint.git. (Issues #930 and #934, Thanks Guido Imperiale and KOLANICH)
Fix HTML (Jupyter Notebook) and LateX representation of some units (Issues #927 / #928 / #933, Thanks Guido Imperiale)
Fixed the definition of RKM unit as gf / tex (Issue #921, Thanks Giuseppe Corbelli)
BREAKING CHANGE: Implement NEP-18 https://numpy.org/neps/nep-0018-array-function-protocol.html for Pint Quantities. Most NumPy functions that previously stripped units when applied to Pint Quantities will now return Quantities with proper units (on NumPy v1.16 with the array_function protocol enabled or v1.17+ by default) instead of ndarrays. Any non-explictly-handled functions will now raise a "no implementation found" TypeError instead of stripping units. The previous behavior is maintained for NumPy < v1.16 and when the array_function protocol is disabled. (Issue #905, Thanks Jon Thielen and andrewgsavage)
Implementation of NumPy ufuncs has been refactored to share common utilities with NumPy function implementations (Issue #905, Thanks Jon Thielen)
Pint Quantities now support the @ matrix mulitiplication operator (on NumPy v1.16+),
as well as the dot, flatten, astype, and item methods.
(Issue #905, Thanks Jon Thielen)
BREAKING CHANGE: Fix crash when applying pprint to large sets of Units. DefinitionSyntaxError is now a subclass of SyntaxError (was ValueError). DimensionalityError and OffsetUnitCalculusError are now subclasses of TypeError (was ValueError). (Issue #915, Thanks Guido Imperiale)
All Exceptions can now be pickled and can be accessed from the top-level package. (Issue #915, Thanks Guido Imperiale)
Mark regex as raw strings to avoid unnecessary warnings. (Issue #913, Thanks keewis)
Implement registry-based string preprocessing as list of callables. (Issues #429 and #851, thanks Jon Thielen)
Context activation and deactivation is now instantaneous; drastically reduced memory footprint of a context (it used to be ~1.6MB per context; now it's a few bytes) (Issues #909 / #923 / #938, Thanks Guido Imperiale)
BREAKING CHANGE: Drop support for Python < 3.6, numpy < 1.14, and uncertainties < 3.0; if you still need them, please install pint 0.9. Pint now adheres to NEP-29 https://numpy.org/neps/nep-0029-deprecation_policy.html as a rolling dependencies version policy. (Issues #908 and #910, Thanks Guido Imperiale)
Show proper code location of UnitStrippedWarning exception. (Issue #907, thanks Martin K. Scherer)
Reimplement _Quantity.iter to return an iterator. (Issues #751 and #760, Thanks Jon Thielen)
Add http://www.dimensionalanalysis.org/ to README (Thanks Shiri Avni)
Allow for user defined units formatting. (Issue #873, Thanks Ryan Clary)
Quantity, Unit, and Measurement are now accessible as top-level classes (pint.Quantity, pint.Unit, pint.Measurement) and can be instantiated without explicitly creating a UnitRegistry (Issue #880, Thanks Guido Imperiale)
Contexts don't need to have a name anymore (Issue #870, Thanks Guido Imperiale)
"Board feet" unit added top default registry (Issue #869, Thanks Guido Imperiale)
New syntax to add aliases to already existing definitions (Issue #868, Thanks Guido Imperiale)
copy.deepcopy() can now copy a UnitRegistry (Issues #864 and #877, Thanks Guido Imperiale)
Enabled many tests in test_issues when numpy is not available (Issue #863, Thanks Guido Imperiale)
Document the '_' symbols found in the definitions files (Issue #862, Thanks Guido Imperiale)
Improve OffsetUnitCalculusError message. (Issue #839, Thanks Christoph Buchner)
Atomic units for intensity and electric field. (Issue #834, Thanks Øyvind Sigmundson Schøyen)
Allow np arrays of scalar quantities to be plotted. (Issue #825, Thanks andrewgsavage)
Updated gravitational constant to CODATA 2018. (Issue #816, Thanks Jellby)
Update to new SI definition and CODATA 2018. (Issue #811, Thanks Jellby)
Allow units with aliases but no symbol. (Issue #808, Thanks Jellby)
Fix definition of dimensionless units and constants. (Issue #805, Thanks Jellby)
Added RKM unit (used in textile industry). (Issue #802, Thanks Giuseppe Corbelli)
Remove name method definition in BaseRegistry. (Issue #787, Thanks Carlos Pascual)
Added t_force, short_ton_force and long_ton_force. (Issue #796, Thanks Jan Hein de Jong)
Fixed error message of DefinitionSyntaxError (Issue #791, Thanks Clément Pit-Claudel)
Expanded the potential use of Decimal type to parsing. (Issue #788, Thanks Francisco Couzo)
Fixed gram name to allow translation by babel. (Issue #776, Thanks Hervé Cauwelier)
Default group should only have orphan units. (Issue #766, Thanks Jules Chéron)
Added custom constructors from_sequence and from_list. (Issue #761, Thanks deniz195)
Add quantity formatting with ndarray. (Issue #559, Thanks Jules Chéron)
Add pint-pandas notebook docs (Issue #754, Thanks andrewgsavage)
Use µ as default abbreviation for micro. (Issue #666, Thanks Eric Prestat)
Prepare for deprecation announced in Python 3.7 (Issue #747, thanks Simon Willison)
Add support for datetime math. (Issue #510, thanks robertd)
Refactored the Registry in multiple classes for better separation of concerns and clarity.
define call (one definition per line).
(Issue #462)UndefinedUnitError to inherit from AttributeError
(Issue #480, thanks jhidding)Fixed backward incompatibility problem when parsing dimensionless units.
Use NIST as source for most of the unit information.
Added Systems and groups. (Issue #215, #315)
Fix operations with measurments and user defined units. (Issue #204)
Changed travis config to use miniconda for faster testing.
Implemented a standard way to change the registry used in unpickling operations. (Issue #148)
Improved test suite helper functions.
Python 2.6 support (Issue #96, thanks tiagocoutinho)
Integer Division with Arrays. (Issue #80, thanks jdreaver)
Changed comparison between Quantities containing NumPy arrays. (Issue #75) - BACKWARDS INCOMPATIBLE CHANGE
ParseHelper can now parse units named like python keywords. (Issue #69)
Fix get_dimensionality for non multiplicative units. (Issue #66)
fix right division on python 2.7 (Issue #58, thanks natezb)
Your coding agent can read these notes before it upgrades. Set up the MCP server →