-----------------
- **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](https://github.com/numpy/numpy/issues/15200),
this breaks creation of Masked Array Quantities by multiplication on the right.
Read Pint's [NumPy support
documentation](https://pint.readthedocs.io/en/latest/numpy.html) 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:
- fail upon decoration (not execution) by checking wrapped function signature against
wraps/check arguments.
(might BREAK test code)
- wraps only accepts strings and Units (not quantities) to avoid confusion with magnitude.
(might BREAK code not conforming to documentation)
- when strict=True, strings that can be parsed to quantities are accepted as arguments.
- 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
- https://pint.readthedocs.io/en/latest/contexts.html
- https://pint.readthedocs.io/en/latest/currencies.html
(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)