Keno / SIUnits.jl

Efficient unit-checked computation
Other
70 stars 26 forks source link

Pure number vectors are note pure #101

Closed nico202 closed 7 years ago

nico202 commented 7 years ago

Hi, If i multiply [1Hz] 3s I get a 1-element Array{SIUnits.SIQuantity{Int64,m,kg,s,A,K,mol,cd,rad,sr},1}: that cannot be used with function like sin() etc since its a SIUnits array, while it should become pure like 1Hz3s does

tomasaschan commented 7 years ago

What package and Julia version are you on? (If you run versioninfo() and Pkg.status("SIUnits") in the REPL, what's the output?)

On Julia 0.5.0 with SIUnits 0.1.0, I can't reproduce:

julia> [1Hz] * 3s
1-element Array{Int64,1}:
 3
nico202 commented 7 years ago

SIUnits

julia> Pkg.status("SIUnits")
 - SIUnits                       0.1.0

julia version


julia> versioninfo()
Julia Version 0.4.6
Commit 2e358ce* (2016-06-19 17:16 UTC)
Platform Info:
  System: Linux (x86_64-unknown-linux-gnu)
  CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1

I'll close it since the problem seems that I should finally upgrade to latest julia stable version then.

Sorry for the noise, and Thanks!

tomasaschan commented 7 years ago

I did some digging, and the difference seems to stem from the improvements to array comprehensions (and array operations in general) that were introduced with Julia 0.5.

nico202 commented 7 years ago

Cool to know that language improvements works then :) Really need to upgrade