Skip to content
Snippets Groups Projects
Commit 1f3d58a7 authored by François  LAURENT's avatar François LAURENT
Browse files

manual artefact management replaced by LazyArtifacts

parent aaf0859d
No related branches found
Tags 0.1.0
No related merge requests found
Pipeline #69451 passed with stage
in 51 seconds
[chore_sample_output]
git-tree-sha1 = "21f352668bf80009c68c3487fb464df477dc2b7a"
lazy = true
[[chore_sample_output.download]]
url = "https://gitlab.pasteur.fr/nyx/artefacts/-/raw/master/PlanarLarvae/chore_sample_output.tar.gz?inline=false"
sha256 = "56845fa23cf53a58df33f6a4daf48e0a031f3c7e920f9badd62ae07f350b62d8"
......@@ -10,10 +10,8 @@ OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
julia = "1.6"
[extras]
CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
TranscodingStreams = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[targets]
test = ["CodecBzip2", "Downloads", "TranscodingStreams", "Test"]
test = ["LazyArtifacts", "Test"]
using Downloads
using CodecBzip2
using TranscodingStreams
using LazyArtifacts
function make_test_data()
target = "test/data/20150701_105504@FCF_attP2_1500062@UAS_Chrimson_Venus_X_0070@t15@r_LED50_30s2x15s30s#n#n#n@100.outline"
if !Base.Filesystem.isfile(target)
Base.Filesystem.mkpath("test/data")
Downloads.download("http://dl.pasteur.fr/fop/F7B0qbc7/20150701_105504%40FCF_attP2_1500062%40UAS_Chrimson_Venus_X_0070%40t15%40r_LED50_30s2x15s30s%23n%23n%23n%40100.outline.bz2",
target * ".bz2")
open(target, "w") do f
write(f, TranscodingStream(Bzip2Decompressor(), open(target * ".bz2")))
function make_test_data(target="chore_sample_outline")
# we want `targets` to be mutable
isstr = typeof(target) === String
if isstr
targets = [target]
else
# copy
targets = Vector{String}(target)
end
for t in 1:length(targets)
target = targets[t]
# call the `artifact` string macro
if startswith(target, "chore_sample_")
artefact = artifact"chore_sample_output"
dir = "chore_sample_output"
filetype = target[length("chore_sample_")+1:end]
if filetype ("outline", "spine")
throw(DomainError("unknown Chore output: " * filetype))
end
filename = "20150701_105504@FCF_attP2_1500062@UAS_Chrimson_Venus_X_0070@t15@r_LED50_30s2x15s30s#n#n#n@100." * filetype
else
throw(DomainError("unknown artefact: " * target))
end
# return path to individual file instead
path = joinpath(artefact, dir, filename)
targets[t] = path
end
if isstr
targets = targets[1]
end
return targets
end
......@@ -5,8 +5,6 @@ include("makedata.jl")
@testset "PlanarLarvae.jl" begin
make_test_data()
@testset "Choreographies.jl" begin
outline = Float32[156.375, 120.625, 156.375, 120.750, 156.375, 120.875, 156.375, 121.000, 156.375, 121.125, 156.500, 121.125, 156.500, 121.250, 156.500, 121.375, 156.625, 121.375, 156.625, 121.375, 156.750, 121.375, 156.875, 121.375, 156.875, 121.375, 157.000, 121.250, 157.000, 121.250, 157.000, 121.125, 157.125, 121.125, 157.125, 121.000, 157.125, 120.875, 157.250, 120.875, 157.250, 120.750, 157.250, 120.625, 157.250, 120.500, 157.250, 120.375, 157.375, 120.375, 157.375, 120.250, 157.375, 120.125, 157.375, 120.000, 157.500, 120.000, 157.500, 119.875, 157.500, 119.750, 157.500, 119.625, 157.500, 119.500, 157.500, 119.375, 157.625, 119.375, 157.625, 119.250, 157.625, 119.125, 157.625, 119.000, 157.625, 118.875, 157.625, 118.750, 157.500, 118.750, 157.500, 118.750, 157.375, 118.750, 157.375, 118.750, 157.250, 118.875, 157.250, 118.875, 157.125, 118.875, 157.125, 119.000, 157.000, 119.000, 157.000, 119.125, 157.000, 119.250, 156.875, 119.250, 156.875, 119.375, 156.750, 119.375, 156.750, 119.500, 156.750, 119.625, 156.625, 119.625, 156.625, 119.750, 156.625, 119.875, 156.625, 120.000, 156.500, 120.000, 156.500, 120.125, 156.500, 120.250, 156.500, 120.375, 156.500, 120.500]
outline_x = Float32[156.375, 156.375, 156.375, 156.375, 156.375, 156.500, 156.500, 156.500, 156.625, 156.625, 156.750, 156.875, 156.875, 157.000, 157.000, 157.000, 157.125, 157.125, 157.125, 157.250, 157.250, 157.250, 157.250, 157.250, 157.375, 157.375, 157.375, 157.375, 157.500, 157.500, 157.500, 157.500, 157.500, 157.500, 157.625, 157.625, 157.625, 157.625, 157.625, 157.625, 157.500, 157.500, 157.375, 157.375, 157.250, 157.250, 157.125, 157.125, 157.000, 157.000, 157.000, 156.875, 156.875, 156.750, 156.750, 156.750, 156.625, 156.625, 156.625, 156.625, 156.500, 156.500, 156.500, 156.500, 156.500]
......@@ -30,7 +28,8 @@ include("makedata.jl")
end
@testset "Outlines.jl" begin
outline = Outlines.read_outline(RawOutline, "test/data/20150701_105504@FCF_attP2_1500062@UAS_Chrimson_Venus_X_0070@t15@r_LED50_30s2x15s30s#n#n#n@100.outline")
target = make_test_data("chore_sample_outline")
outline = Outlines.read_outline(RawOutline, target)
@test length(outline) == 1
@test haskey(outline, "20150701_105504")
outline′ = outline["20150701_105504"]
......@@ -41,7 +40,7 @@ include("makedata.jl")
timestamp, outline‴ = outline″[end]
@test timestamp == 120.162
@test outline‴ == Float32[156.375, 120.625, 156.375, 120.750, 156.375, 120.875, 156.375, 121.000, 156.375, 121.125, 156.500, 121.125, 156.500, 121.250, 156.500, 121.375, 156.625, 121.375, 156.625, 121.375, 156.750, 121.375, 156.875, 121.375, 156.875, 121.375, 157.000, 121.250, 157.000, 121.250, 157.000, 121.125, 157.125, 121.125, 157.125, 121.000, 157.125, 120.875, 157.250, 120.875, 157.250, 120.750, 157.250, 120.625, 157.250, 120.500, 157.250, 120.375, 157.375, 120.375, 157.375, 120.250, 157.375, 120.125, 157.375, 120.000, 157.500, 120.000, 157.500, 119.875, 157.500, 119.750, 157.500, 119.625, 157.500, 119.500, 157.500, 119.375, 157.625, 119.375, 157.625, 119.250, 157.625, 119.125, 157.625, 119.000, 157.625, 118.875, 157.625, 118.750, 157.500, 118.750, 157.500, 118.750, 157.375, 118.750, 157.375, 118.750, 157.250, 118.875, 157.250, 118.875, 157.125, 118.875, 157.125, 119.000, 157.000, 119.000, 157.000, 119.125, 157.000, 119.250, 156.875, 119.250, 156.875, 119.375, 156.750, 119.375, 156.750, 119.500, 156.750, 119.625, 156.625, 119.625, 156.625, 119.750, 156.625, 119.875, 156.625, 120.000, 156.500, 120.000, 156.500, 120.125, 156.500, 120.250, 156.500, 120.375, 156.500, 120.500]
outline = Outlines.read_outline("test/data/20150701_105504@FCF_attP2_1500062@UAS_Chrimson_Venus_X_0070@t15@r_LED50_30s2x15s30s#n#n#n@100.outline")
outline = Outlines.read_outline(target)
i = 0
for (larva_id, outline′) in pairs(outline["20150701_105504"])
i += 1
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment