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
@@ -0,0 +1,6 @@
|
||||
module MyTestPackage
|
||||
|
||||
include("find.jl")
|
||||
export find_max
|
||||
export find_mean
|
||||
end # module MyTestPackage
|
||||
16
material/2_tue/testing/MyTestPackage/src/find.jl
Normal file
16
material/2_tue/testing/MyTestPackage/src/find.jl
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
function find_max(x::AbstractVector)
|
||||
@assert all(!isnan,x)
|
||||
currentmax = x[1]
|
||||
for a = eachindex(x)
|
||||
if x[a] > currentmax
|
||||
currentmax = x[a]
|
||||
end
|
||||
end
|
||||
return currentmax
|
||||
end
|
||||
|
||||
function find_mean(x::AbstractVector)
|
||||
@assert all(!isnan,x)
|
||||
return sum(x)./length(x)
|
||||
end
|
||||
Reference in New Issue
Block a user