- v0.14.0
- Support for
digits
kwarg (#196). - Try to support precompilation with
u_str
macro (#201).
- Support for
- v0.13.0
- Implement affine quantities for better temperature handling (#177, #182).
- Rename
°Ra
toRa
to emphasize that it is an absolute scale. - Fix some precompilation issues (#161).
- Add
Velocity
,Acceleration
,Density
derived dimensions (#187). - Days display as
d
now (#184). - Type signature of
Quantity
s has been simplified. Helps with reading error messages (#183). - Support
isequal
withNaN
quantities (#172).
- v0.12.0
- Bug fixes.
- Support carrier-to-noise-density ratio (C/N0) in dB-Hz.
- Added dimensions:
DField
,EField
,ElectricDipoleMoment
,ElectricQuadrupoleMoment
,MagneticDipoleMoment
. - Added unit:
barn
. - Some documentation improvements.
- v0.11.0--v0.9.0
- Fixes for Julia 0.7 update, primarily.
- Some new TwicePrecision functionality for quantities.
- v0.8.0
- Add Rydberg constant, unified atomic mass unit, mils, rpm, rps, percent, permille.
- Introduce/rename derived dimensions: ElectricalConductivity, ElectricalResistivity, ElectricalConductance, ElectricalResistance.
- Fix some Julia 0.7 deprecations.
- This will probably be the last release that supports Julia 0.6.
- v0.7.1
- Bug fixes, mainly.
- v0.7.0
- Implement
mod2pi
for degrees, cleanup display of degree units. - Tweak implementation of
Gain
types for usability. - Implement
zero
andone
forLevel
andGain
. - Add a few more cgs units.
- Tests pass on 32-bit systems, for the first time in a long time (ever?).
- Implement
- v0.6.1
- Permit symbols that are bound to
Number
s to be used inu_str
macro, such that π and other non-literal numbers can be used. - Add some cgs units and a few dimensions #115.
- Fix a comparison / promotion bug introduced in v0.6.0.
- Permit symbols that are bound to
- v0.6.0
- Restore compatibility with 0.7.0-DEV.
- v0.5.1
- Dimensionless quantities no longer lose their units when dividing by a real number.
- Ranges constructed via
range
orcolon
should work more reliably (e.g., 0:10°:350° works now).
- v0.5.0
- Add
dBΩ
anddBS
to permit working with impedances and admittances in dB. These are used in the Touchstone format and in microwave measurements. - Implement
angle
forQuantity{<:Complex}
. - Implement
float
forGain
,Level
. - Replace
fieldratio
androotpowerratio
withuconvertrp
.- Permits unit conversion between
NoUnits
anddB
, etc. by presuming unitless ratios are of root-power quantities (hence therp
afteruconvert
). uconvertrp
has generic fallbacks and can be used as a drop-in replacement foruconvert
otherwise.
- Permits unit conversion between
- Likewise, replace
powerratio
withuconvertp
for ratios of power quantities. - Introduce
convertrp
andconvertp
. These are likeconvert
but they make similar assumptions about unitless ratios being of power or root-power quantities, respectively. - Implement more division operations for
Gain
s (accidental omissions)
- Add
- v0.4.0
- Introduce logarithmic quantities (experimental!)
- Update syntax for Julia 0.6 and reorganize code for clarity.
- Redefine
ustrip(x::Quantity) = ustrip(x.val)
. In most cases, this is unlikely to affect user code. The generic fallbackustrip(x::Number)
remains unchanged. isapprox(1.0u"m",5)
returnsfalse
instead of throwing aDimensionError
, in keeping with the behavior of an equality check (==
).- Display of some units has changed to match their symbols #104.
- Don't export
cd
from Unitful.DefaultSymbols in order to avoid conflicts #102. - Deprecated
dimension(x::AbstractArray{T}) where T<:Number
, use broadcasting instead. - Deprecated
dimension(x::AbstractArray{T}) where T<:Units
, use broadcasting instead. - Deprecated
ustrip(A::AbstractArray{T}) where T<:Number
, use broadcasting instead. - Deprecated
ustrip(A::AbstractArray{T}) where T<:Quantity
, use broadcasting instead.
- v0.3.0
- v0.2.6
- v0.2.5
- v0.2.4
- Bug fix: avoid four-argument
promote_type
- Bug fix: define method for
*(::Base.TwicePrecision, ::Quantity)
- Bug fix: definition of Bohr magneton had
e
instead ofq
- Bug fix: avoid four-argument
- v0.2.3
- Dimensionful quantities are no longer accepted for
floor
,ceil
,trunc
,round
,isinteger
. The choice of units can yield physically different results. The functions are defined for dimensionless quantities, and return unitless numbers. Closes #78. - Added
gn
, a constant quantity for the gravitational acceleration on earth #75. - Added
ge
, the gravitational acceleration on earth as a unit #75. - Added
lbf
, pounds-force unit #75.
- Dimensionful quantities are no longer accepted for
- v0.2.2
- Fixed a bug in promotion involving
ContextUnits
where the promotion context might not be properly retained.
- Fixed a bug in promotion involving
- v0.2.1
- v0.2.0
Units{N,D}
is now an abstract type. Different concrete types for units give different behavior under conversion and promotion. The currently implemented concrete types are:FreeUnits{N,D}
: these give the typical behavior from prior versions of Unitful. Units defined in Unitful.jl and reachable by theu_str
macro are allFreeUnits
.ContextUnits{N,D,P}
, where P is some typeFreeUnits{M,D}
: these enable context-specific promotion rules, e.g. if units are defined in different packages.FixedUnits{N,D}
: these inhibit automatic conversion of quantities with different units.
LengthUnit
,EnergyUnit
, etc. are renamed toLengthUnits
,EnergyUnits
, etc. for consistency (they are related more toUnits
objects thanUnit
objects). You can still use the old names for now, but please switch over to using...Units
instead of...Unit
in this release as the old names will be removed in a future release.c
is now a unit, to permit converting mass intoMeV/c^2
, for example.c0
is still a quantity equal to the speed of light in vacuum, in units ofm/s
#67.
- v0.1.5
- v0.1.4
- Critical bug fix owing to
mod_fast
changes.
- Critical bug fix owing to
- v0.1.3
- Fix symmetry of
==
#56. - Using
@refunit
will implicitly specify the ref. unit as the default for promotion. This will not change behavior for most people; it just ensures promotion won't fail for quantities with user-defined dimensions. - Remove
mod_fast
in anticipation of Julia PR #20859. - Allow tolerance args for
isapprox
#57
- Fix symmetry of
- v0.1.2
- On Julia 0.6, exponentiation by a literal is now type stable for integers.
- v0.1.1
- Fixed a macro hygiene issue that prevented
@dimension
and@derived_dimension
from working properly if Compat was not imported in the calling namespace.
- Fixed a macro hygiene issue that prevented
- v0.1.0
- Julia 0.6 compatibility.
- On Julia 0.6, exponentiation by a literal is now type stable for common integer powers: -3, -2, -1, 0, 1, 2, 3.
- Added missing methods for dot operators
.<
and.<=
(Julia 0.5, fix #55). - Fix #45. Ranges should work as expected on Julia 0.6. On Julia 0.5, Ranges.jl is used to make ranges work as well as possible given limitations in Base.
- Fix #33,
#42,
and #50.
deps/Defaults.jl
is dead. Long livedeps/Defaults.jl
. To define your own units, dimensions, and so on, you should now put them in a module, or ideally a package so that others can use the definitions too. You can override default promotion rules immediately after loading Unitful and dependent packages; this will generate method overwrite warnings on Julia 0.5 but not on 0.6. @u_str
macro has been improved. It can now traverse separate unit packages, as well as return tuples ofUnits
objects.@preferunit
has been replaced with a functionpreferunits
.- Added some methods for
ustrip
. - Implement
typemin
,typemax
,cbrt
forQuantity
s. - Added matrix inversion for
StridedMatrix{T<:Quantity}
. - Added
istriu
,istril
forAbstractMatrix{T<:Quantity}
. - The
Unitful.SIUnits
module has been renamed toUnitful.DefaultSymbols
. - Add
lb
,oz
,dr
,gr
to Unitful (international Avoirdupois mass units).
- v0.0.4
- Be aware, breaking changes to
deps/Defaults.jl
caused by some of the following! - Fix #40.
- Fix #30.
- Support relevant
@fastmath
operations forQuantity
s. - Implement
fma
,atan2
forQuantity
s. - Implement
cis
for dimensionlessQuantity
s. - Removed
DimensionedUnits
andDimensionedQuantity
abstract types. They were of dubious utility, and this change shortened the promotion code considerably. More importantly, this change has made it possible to write methods like the following, without method ambiguities:uconvert(e::EnergyUnit, f::Frequency) = uconvert(e, u"h"*f)
. - Promotion wraps usual
Number
types in dimensionless, unitlessQuantity
types when promoted together with dimensionfulQuantity
s. WithQuantity
s it is not always possible to promote to a common concrete type, but this way we can at least ensure that the numeric backing types are all promoted: (promote(1.0u"m", 1u"N"//2, 0x08) == (1.0 m,0.5 N,8.0)
, where8.0
is actually a dimensionless, unitlessQuantity
). The usual outer constructor forQuantity
s (Quantity(val::T, unit)
) continues to return a number of typeT
if the unit isNoUnits
, since most of the time the user would prefer aNumber
type from base rather than a dimensionless, unitless quantity. - Add more units to defaults:
bar
(bar),Torr
(torr),atm
(atmosphere),l
orL
(liter; both symbols accepted). You will need to deletedeps/Defaults.jl
in the Unitful package directory to get the new units. - Two character encodings for
μ
in SI prefixes are now generated automatically (some logic moved out of defaults). - Moved definition of
sin
,cos
,tan
,sec
,csc
,cot
out ofdeps/build.jl
and intosrc/Unitful.jl
.
- Be aware, breaking changes to
- v0.0.3
- Bug fix:
uconvert(°C, 0x01°C)
no longer disturbs the numeric type - Allow μ-prefixed units to be typed with option-m on a Mac, in addition to
using Unicode. Previously only
μm
could be typed this way. - Include a
baremodule
calledSIUnits
in the factory defaults. You can now dousing Unitful.SIUnits
to bring all of the SI units into the calling namespace. - Added remaining SI units to the factory defaults:
sr
(steradian),lm
(luminous flux),lx
(illuminance),Bq
(becquerel),Gy
(gray),Sv
(sievert),kat
(katal). - Simplify array creation, as in
[1, 2]u"km"
#29 - Support multiplying ranges by units, as in
(1:3)*mm
#28 - Bug fix #26
- Promoting
Quantity
s with different dimensions now returns quantities with the same numeric backing type, e.g.Quantity{Float64}
. Ideally, this would also be true if you mixed unitless and unitful numbers during promotion, but that is not yet the case. See #24 for motivation.
- Bug fix:
- v0.0.2
- Bug fixes (
[1.0m, 2.0m] ./ 3
would throw aUnitful.DimensionError()
). Promotion still isn't perfect, but it is hard for me to see what@inferred
errors are real until JuliaLang/julia#18465 is resolved. - Made units callable for unit conversion:
u"cm"(1u"m") == 100u"cm"//1
. Note thatUnits
objects have no fields, so this is totally unambiguous. Moreover, we have convenient syntax for unit conversion by function chaining:1u"m" |> u"cm" == 100u"cm"//1
. Note thatuconvert
will remain supported.
- Bug fixes (
- v0.0.1 - Initial release