Skip to content

Commit

Permalink
Added more tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
cncastillo committed Dec 22, 2022
1 parent 46e4359 commit 38db949
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@ end
@test xx1 xx2
end

@testitem "TrapezoidalIntegration" begin
dt = Float64[1 1 1 1]
x = Float64[0 1 2 1 0]

@test KomaMRI.trapz(dt, x)[1] 4 #Triangle area = bh/2, with b = 4 and h = 2

@test KomaMRI.cumtrapz(dt, x) [0.5 2 3.5 4]
end

@testitem "BlochSim_CPU_sigle_thread" tags=[:important] begin
using Suppressor, HDF5
path = @__DIR__
Expand All @@ -212,12 +221,12 @@ end
"gpu"=>false,
"Nthreads"=>1,
"sim_method"=>KomaMRI.Bloch(),
"return_type" => "mat"
"return_type"=>"mat"
)
sig = @suppress simulate(obj, seq, sys; simParams)
sig = sig / prod(size(obj))

sig_jemris = h5open(path*"/test_files/signals_epi_sphere_cs.h5")["/signal/channels/00"]
sig_jemris = h5open(path*"/test_files/jemris_signals_epi_sphere_cs.h5")["/signal/channels/00"]
sig_jemris = sig_jemris[1,:] + 1im*sig_jemris[2,:]
sig_jemris = sig_jemris[:]

Expand All @@ -236,12 +245,12 @@ end
simParams = Dict{String, Any}(
"gpu"=>false,
"sim_method"=>KomaMRI.Bloch(),
"return_type" => "mat"
"return_type"=>"mat"
)
sig = @suppress simulate(obj, seq, sys; simParams)
sig = sig / prod(size(obj))

sig_jemris = h5open(path*"/test_files/signals_epi_sphere_cs.h5")["/signal/channels/00"]
sig_jemris = h5open(path*"/test_files/jemris_signals_epi_sphere_cs.h5")["/signal/channels/00"]
sig_jemris = sig_jemris[1,:] + 1im*sig_jemris[2,:]
sig_jemris = sig_jemris[:]

Expand All @@ -260,12 +269,12 @@ end
simParams = Dict{String, Any}(
"gpu"=>true,
"sim_method"=>KomaMRI.Bloch(),
"return_type" => "mat"
"return_type"=>"mat"
)
sig = @suppress simulate(obj, seq, sys; simParams)
sig = sig / prod(size(obj))

sig_jemris = h5open(path*"/test_files/signals_epi_sphere_cs.h5")["/signal/channels/00"]
sig_jemris = h5open(path*"/test_files/jemris_signals_epi_sphere_cs.h5")["/signal/channels/00"]
sig_jemris = sig_jemris[1,:] + 1im*sig_jemris[2,:]
sig_jemris = sig_jemris[:]

Expand Down
File renamed without changes.

2 comments on commit 38db949

@cncastillo
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/74512

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.1 -m "<description of version>" 38db949ba681ca6f645335cb8fc4ce326bba8723
git push origin v0.7.1

Please sign in to comment.