- Fix converion of a
Measurement
object to anInt
. This fixes also power of complex measurements. - Ensure that
Measurement{T}(x)
returns aMeasurement{T}
(#24). Until Julia 0.6 this was done automatically, now we have to test this explicitly.
- Julia 0.7 is required, support for previous versions was dropped.
- Documentation has been movedo to https://juliaphysics.github.io/Measurements.jl/stable/.
- You can easily plot vectors of
Measurement
objects using thePlots.jl
package. The uncertainties of the numbers will automatically be used as sizes of the errorbars. @uncertain
macro automatically converts all arguments of the function call toMeasurement
type, so that the user does not have to manually cast them.- New method for
measurement(x::Measurement)
returningx
. - New methods for
Measurements.value(x::Real)
returningx
andMeasurements.uncertainty(x::Real)
returningzero(x)
. - The package now supports pretty printing in Juno (#12, #13)
- The tag used internally to identify an independent quantity is now a (thread-safe) counter, rather than a (thread-unsafe) random number (#15, #16).
- New
show
method fortext/latex
MIME, used in Jupyter notebooks.
isinteger
andiszero
now check also that the uncertainty is zero.- Comparison between
Measurement
andReal
with==
now compares also the uncertainty, so that theMeasurement
must have uncertainty equal to zero to be equal to a real number. - Comparison between
Measurement
andIrrational
with==
now gives alwaysfalse
, consistently with the rest ofReal
types.
- New mathematical operations supported:
sinpi
,cospi
,sinc
,cosc
,asec
,acsc
,acot
,asech
,acsch
,acoth
,sincos
(the last one only on Julia 0.7). - It is now possible to parse a string as a
Measurement{T}
with anyT<:AbstractFloat
(not onlyMeasurement{Float64}
), as long as the parsing method is able to digest the string. Tested withT
equal toFloat16
,Float32
,Float64
, andBigFloat
.
- Support for Julia 0.4 and 0.5 was dropped.
value
anduncertainty
functions are no more exported.Measurements.gradient
function has been removed. Use the vectorized functionMeasurements.derivative.(x, array)
instead.
- There were several performance improvements, both in speed and memory usage.
These improvements are more evident for simple operations like addition and
subtraction (now these operations are 2-3 times faster than in v0.3.0). In
addition, the overhead of operations with arrays of
Measurement
s and complexMeasurement
s was greatly reduced by avoiding useless conversions (now summing an array is 100 times faster than in v0.3.0).
quadgk
function fromQuadGK.jl
package is extended to supportMeasurement
objects as endpoints of integration (#8). Note that only the case of two real endpoints is supported.- Real
Measurement
objects can be printed with"text/x-tex"
and"text/x-latex"
MIME types.\pm
TeX macro is used to render the±
sign. - A new
parse
method is provided, to parse a string toMeasurement{Float64}
. This is the same as callingmeasurement
with a string argument.
- New function
Measurements.uncertainty_components
to compute the components of the total uncertainty of a derived quantity.
- When both arguments of
stdscore
areMeasurement
, the standard score between their difference and zero is now computed, in order to test their consistency. This is most probably what users will expect. As a consequence of this change, the returned value is never aMeasurement
.
- New method for
measurement
: you can parse a string in order to create aMeasurement
object. - It is now possible to perform calculations involving numbers that have
NaN
as nominal value and/or uncertainty. In previous versions it was possible only to define such numbers, but not to perform calculations with them. - Performance of
sum
andprod
with arrays ofMeasurement
s has been slightly improved. Now they are quadratic in the number of input arguments, instead of cubic. - Improve printing of complex measurements. Now each part, real and imaginary, is wrapped in parentheses in order to make it easier to distinguish them.
- New mathematical operations supported:
log2
,abs2
,fma
,muladd
,besseli
,besselix
,besselk
,besselkx
,widen
,big
.
- The constructor of
Measurement
objects that you should directly use has been renamed tomeasurement
. What you have to do in your programs is to replace all occurrences of the uppercase version with the lowercase one.Measurement
constructor is still exported, but you should never use it (unless you know how it works).±
is now an alias ofmeasurement
, so you do not need change anything if you used this sign in place of theMeasurement
function.
measurement
function is made vectorial, so you can create an array ofMeasurement
objects by feeding it with the array of nominal values and uncertainties.- New functions
value
anduncertainty
to access the nominal value and the uncertainty of measurements.
- Fix derivatives of
div
,fld
,cld
. - Fix
frexp
with arguments whose absolute value is less than 0.5.
@uncertain
macro works with functions with any number of arguments.- New mathematical operations supported:
erfi
,dawson
,digamma
,invdigamma
,trigamma
,polygamma
,beta
,lbeta
,airy
,airyai
,airyprime
,airyaiprime
,airybi
,airybiprime
. - The complete documentation of the package is available at http://measurementsjl.readthedocs.io
- Support for correlated variables has been added (#3).
- Full support for complex measurements.
- Macro
@uncertain
enables propagation of uncertainty in any real function of one or two real arguments, including those functions making use of C/Fortran calls (#4). - New functions
Measurements.derivative
andMeasurements.gradient
to get the derivative and the gradient of an expression with respect to one or more independent measurements. - Precompilation enabled.
- New method supported:
typemax
.
Measurement
is now subtype ofAbstractFloat
(#1), but you can feed the constructor with any subtype ofReal
that can be converted to anAbstractFloat
.- New
weightedmean
function for calculating the weighted mean of measurements using inverse-variance weighting. - New mathematical operations supported:
modf
,exp10
,isnan
,isfinite
,isinf
,isinteger
,copysign
,frexp
,ldexp
,div
,cld
,fld
,mod
,rem
,mod2pi
,eps
,flipsign
,erfinv
,erfcinv
,erfcx
.
- Function
Constant
has been removed as it was mostly redundant and badly capitalized (#2). - In order to define complex
Measurement
s you have to usecomplex(Measurement(a, b), Measurement(c, d))
so real and imaginary parts of the number have each their uncertainty.
- Fix multiplication by and division of 0. Previously, those operations would
return
NaN
as uncertainty, now they give 0.
Initial release.
Measurement
type is a parametric type, subtype ofNumber
.- You can define
Measurement
objects withMeasurement(a, b)
, beinga
the value of the measurement, andb
its uncertainty as standard deviation. You can also employ the shorter syntaxa ± b
. - The function
stdscore
to calculate the standard score is available. - Mathematical operation supported:
+
,-
,*
,/
,inv
,^
,exp2
,cos
,sin
,deg2rad
,rad2deg
,cosd
,sind
,cosh
,sinh
,tan
,tand
,tanh
,acos
,acosd
,acosh
,asin
,asind
,asinh
,atan
,atan2
,atand
,atanh
,csc
,cscd
,csch
,sec
,secd
,sech
,cot
,cotd
,coth
,exp
,expm1
,log
,log10
,log1p
,hypot
,sqrt
,cbrt
,abs
,sign
,zero
,one
,erf
,erfc
,factorial
,gamma
,lgamma
,signbit
.