Skip to content

Commit

Permalink
test: set random seed for consistent results
Browse files Browse the repository at this point in the history
  • Loading branch information
cpaniaguam committed Dec 17, 2024
1 parent 003930a commit b2eb1d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test-long-tracker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ begin # Load data
IceFloeTracker.addfloemasks!(_props, _imgs)
IceFloeTracker.addψs!(_props)
IceFloeTracker.add_passtimes!(_props, _passtimes)
Random.seed!(123)
IceFloeTracker.adduuid!(_props)
end

Expand Down Expand Up @@ -87,7 +88,7 @@ end

# Expected: 5 trajectories, 3 of which have length 3 and 2 of which have length 2
IDs = trajectories[!, :ID]
@test IDs == [1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5]
@test IDs == [1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5]
end

@ntestset "Test gaps" begin
Expand All @@ -106,12 +107,11 @@ end
@ntestset "Case 4" begin
# Add gaps to props_test_case2
props = addgaps(props_test_case2)

trajectories = IceFloeTracker.long_tracker(props, condition_thresholds, mc_thresholds)

# Expected: 5 trajectories, 3 of which have length 3 and 2 of which have length 2 as in test case 2
IDs = trajectories[!, :ID]
@test IDs == [1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5]
@test IDs == [1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5]
end
end

Expand Down

0 comments on commit b2eb1d0

Please sign in to comment.