summaryrefslogtreecommitdiff
path: root/CHANGES
diff options
context:
space:
mode:
authorConstantine Evans <const@costi.eu>2022-02-09 01:25:10 +0000
committerConstantine Evans <const@costi.eu>2022-02-09 01:25:10 +0000
commitc50074000fb31e3b2fd86988459d40f0d3cac497 (patch)
treed08f50fe38c7643c48e28e68a903040b63f6ffcf /CHANGES
parent5403f46ecf636d0749cf54cddf725d177d60af61 (diff)
downloadpint-c50074000fb31e3b2fd86988459d40f0d3cac497.tar.gz
Fix to_compact, infer_base_unit for non-float non_int_type (#1461)
to_compact used math.log10, which converted non-float types to floats; this caused exceptions when using a non-integer type, like Decimal, that does not implement multiplication/division with floats, and generally changed non-integer types to floats. This addresses the problem by checking non_int_type. If non_int_type != float, it assumes that the type implements a log10 method, as Decimal does. infer_base_unit created a generic UnitsContainer, not a UnitsContainer specific to a registry; this allows specification of a registry, or uses the registry of the passed-in Quantity/UnitLike.
Diffstat (limited to 'CHANGES')
-rw-r--r--CHANGES1
1 files changed, 1 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 2de0a4e..ba0397c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -16,6 +16,7 @@ Pint Changelog
- Use default numpy `np.printoptions` available since numpy 1.15.
- Implement `numpy.nanprod` (Issue #1369)
- Fix default_format ignored for measurement (Issue #1456)
+- Fix `to_compact` and `infer_base_unit` for non-float non_int_type.
### Breaking Changes