Add material for testing (#11)
* Add first draft material for testing * added some first test stuff in julia * add asserti error * Rework intro slides * added package * Wrap up testing slides expect demo * Smooth demo part * Add statement on tests * Remove previous python exercise file --------- Co-authored-by: behinger (s-ccs 001) <benedikt.ehinger@vis.uni-stuttgart.de>
This commit is contained in:
committed by
GitHub
parent
e6f7ff3ed1
commit
937a8a9481
@@ -1,6 +1,6 @@
|
||||
#---
|
||||
using ProgressMeter
|
||||
|
||||
import Base: length
|
||||
function rse_sum(x)
|
||||
s = 0
|
||||
@showprogress for k = eachindex(x)
|
||||
@@ -32,21 +32,22 @@ end
|
||||
rse_tstat(2:3) == 5
|
||||
|
||||
#---
|
||||
|
||||
struct StatResult
|
||||
x::Vector
|
||||
n::Int32
|
||||
std::Float64
|
||||
tvalue::Float64
|
||||
end
|
||||
length(s::StatResult) = s.n
|
||||
Base.length(s::StatResult) = s.n
|
||||
StatResult(x) = StatResult(x,length(x))
|
||||
|
||||
StatResult(x,n) = StatResult(x,n,rse_std(x))
|
||||
StatResult(x,n,std) = StatResult(x,n,)
|
||||
StatResult(x,n,std) = StatResult(x,n,std,rse_tstat(x;σ=std))
|
||||
|
||||
|
||||
mystatresult(10,500.) # <1>
|
||||
StatResult([10,500.]) # <1>
|
||||
|
||||
function tstat(x) # <2> generate a function returning our new type
|
||||
return mystatresult(length(x),rse_tstat(x))
|
||||
function tstat(x)
|
||||
return StatResult(length(x),rse_tstat(x))
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user