Skip to content

Commit

Permalink
attempt at correcting test
Browse files Browse the repository at this point in the history
  • Loading branch information
warisa-r committed Aug 31, 2024
1 parent 979ad2f commit ab94538
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/sod_shock_tube_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using ShockwaveProperties
using Unitful
using ShockwaveDetection

flow_data = FlowData("data/sod_shock_left_1d.tape", false)
flow_data = FlowData("example/data/sod_shock_left_1d.tape", false)

shock_positions_over_time = detect(flow_data, GradientShockDetectionAlgo(0.5))
anim = create_wave_animation_with_shock(flow_data, shock_positions_over_time)
2 changes: 1 addition & 1 deletion examples/sod_shock_tube_2d.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ShockwaveDetection
ENV["JULIA_NUM_THREADS"] = "4"

flow_data = FlowData("data/sod_shock_right_2d.tape", false)
flow_data = FlowData("example/data/sod_shock_right_2d.tape", false)

point_detect_algo = ImageProcessingShockDetectionAlgo(0.5, :prewitt)
dbscan_algo = DBSCANAlgo(0.25, 3, 10)
Expand Down
12 changes: 10 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
using Test
using ShockwaveDetection

DATA_DIR = pkgdir(ShockwaveDetection, "examples", "data")

@testset "Compiles" begin
using ShockwaveDetection
end

@testset "1D shock detection" begin
include("../examples/sod_shock_tube_1d.jl")
flow_data = FlowData(joinpath(DATA_DIR, "sod_shock_left_1d.tape"), false)
shock_positions_over_time = detect(flow_data, GradientShockDetectionAlgo(0.5))
anim = create_wave_animation_with_shock(flow_data, shock_positions_over_time)
rm("density_velocity_pressure_over_time_with_shock_positions.gif")
end

@testset "2D shock detection" begin
include("../examples/sod_shock_tube_2d.jl")
flow_data = FlowData(joinpath(DATA_DIR, "sod_shock_right_2d.tape"), false)
point_detect_algo = ImageProcessingShockDetectionAlgo(0.5, :prewitt)
dbscan_algo = DBSCANAlgo(0.25, 3, 10)
detection = detect(flow_data, point_detect_algo, dbscan_algo)
plot_shock_fits_over_time(flow_data, detection, true)
end

0 comments on commit ab94538

Please sign in to comment.