Skip to content

Commit 8033be4

Browse files
authored
Make constrainedLCS less vulnerable (#75)
1 parent 45c9984 commit 8033be4

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

src/ellipticLCS.jl

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,23 +1271,6 @@ function constrainedLCS(
12711271

12721272
vortices = EllipticVortex[]
12731273

1274-
#Type of restricted field is quite complex, therefore make a variable for it here
1275-
qType = AxisArrays.AxisArray{
1276-
SVector{2,S},
1277-
2,
1278-
Array{SVector{2,S},2},
1279-
Tuple{
1280-
AxisArrays.Axis{
1281-
:row,
1282-
StepRangeLen{S,Base.TwicePrecision{S},Base.TwicePrecision{S}},
1283-
},
1284-
AxisArrays.Axis{
1285-
:col,
1286-
StepRangeLen{S,Base.TwicePrecision{S},Base.TwicePrecision{S}},
1287-
},
1288-
},
1289-
}
1290-
12911274
# We make two remote channels. The master process pushes to jobs_rc in order
12921275
# (vx, vy, vr, p, outermost, T_local):
12931276
# * vx::S,vy::S (coordinates of vortex center)
@@ -1304,7 +1287,7 @@ function constrainedLCS(
13041287

13051288

13061289
jobs_rc = RemoteChannel(
1307-
() -> Channel{Tuple{S,S,S,LCSParameters,Bool,qType}}(jobs_queue_length),
1290+
() -> Channel{Tuple{S,S,S,LCSParameters,Bool,typeof(q)}}(jobs_queue_length),
13081291
)
13091292
results_rc = RemoteChannel(
13101293
() -> Channel{Tuple{S,S,Vector{EllipticBarrier}}}(results_queue_length),

test/test_elliptic.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ end
147147
p = @inferred LCSParameters(1.0, 3*max(step(xspan), step(yspan)), mhs, 60, 0.5, 1.5, 1e-4)
148148
@inferred critical_point_detection(q, p.indexradius; merge_heuristics=mhs)
149149
150+
constrainedLCS(q, p; verbose=false, debug=true)
150151
vortices, singularities = @inferred constrainedLCS(q, p; verbose=false)
151152
@test sum(map(v -> length(v.barriers), vortices)) == 1
152153
@test singularities isa Vector{Singularity}

0 commit comments

Comments
 (0)