Skip to content

Commit e8263de

Browse files
committed
parallelize tests
1 parent 4837e1e commit e8263de

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/dynamicalsystems.jl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,34 @@ dict_keys = ["Sine wave","White noise","Hénon (chaotic)","Hénon (periodic)"]
4242
dmat = distancematrix(xe, ye)
4343
crmat = CrossRecurrenceMatrix(xe, ye, ε)
4444
@test Matrix(crmat.data) == (dmat .≤ ε)
45-
rmat = RecurrenceMatrix(xe, ε)
46-
jrmat = JointRecurrenceMatrix(xe, ye, ε)
45+
rmat = RecurrenceMatrix(xe, ε; parallel = false)
46+
rmat_p = RecurrenceMatrix(xe, ε; parallel = true)
47+
jrmat = JointRecurrenceMatrix(xe, ye, ε; parallel = false)
4748
sz = size(jrmat)
4849
@test (jrmat.data .& rmat.data[1:sz[1],1:sz[2]]) == jrmat.data
50+
@test (jrmat.data .& rmat_p.data[1:sz[1],1:sz[2]]) == jrmat.data
4951
# Compare metrics
5052
m_euc = rmat
53+
m_euc_p = rmat_p
5154
m_max = RecurrenceMatrix(xe, ε, metric="max")
5255
m_min = RecurrenceMatrix(xe, ε, metric="manhattan")
5356
@test (m_max.data .& m_euc.data) == m_euc.data
5457
@test (m_euc.data .& m_min.data) == m_min.data
58+
@test (m_max.data .& m_euc_p.data) == m_eucs.data
59+
@test (m_euc_p.data .& m_min.data) == m_min.data
5560
# Compare scales
5661
m_scalemax = CrossRecurrenceMatrix(xe, ye, 0.1, scale=maximum)
5762
m_scalemean = CrossRecurrenceMatrix(xe, ye, 0.1, scale=mean)
63+
m_scalemax_p = CrossRecurrenceMatrix(xe, ye, 0.1, scale=maximum, parallel = true)
64+
m_scalemean_p = CrossRecurrenceMatrix(xe, ye, 0.1, scale=mean, parallel = true)
5865
@test (m_scalemax.data .& m_scalemean.data) == m_scalemean.data
66+
@test (m_scalemax_p.data .& m_scalemean_p.data) == m_scalemean.data
5967
# Fixed rate for recurrence matrix
6068
crmat_fixed = CrossRecurrenceMatrix(xe, ye, 0.05; fixedrate=true)
69+
crmat_fixed_p = CrossRecurrenceMatrix(xe, ye, 0.05; fixedrate=true, parallel = true)
6170
@test .04 < recurrencerate(crmat_fixed) < .06
71+
@test .04 < recurrencerate(crmat_fixed_p) < .06
72+
@test recurrencerate(crmat_fixed) recurrencerate(crmat_fixed_p)
6273

6374
# Recurrence plot
6475
crp = grayscale(crmat, width=125)

0 commit comments

Comments
 (0)