diff --git a/Project.toml b/Project.toml index 42e4c24b473d581cd75cde40a37fd22d420f60b1..014f4958f3262394f3517b41b9c92c32304465cf 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "LarvaTagger" uuid = "8b3b36f1-dfed-446e-8561-ea19fe966a4d" authors = ["François Laurent", "Institut Pasteur"] -version = "0.16" +version = "0.16.1" [deps] Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" diff --git a/recipes/README.md b/recipes/README.md index 760df31e5cff4553d7b8b203a446c2171e7ffe17..242bb22708bdfa8fd85b5afc8fc664312571e6d5 100644 --- a/recipes/README.md +++ b/recipes/README.md @@ -163,7 +163,7 @@ docker pull flaur/larvatagger ``` Beware that images that ship with backends are relatively large files (>5GB on disk). -If you are not interested in automatic tagging, use the `flaur/larvatagger:0.16-standalone` image instead. +If you are not interested in automatic tagging, use the `flaur/larvatagger:0.16.1-standalone` image instead. ### Upgrading diff --git a/scripts/larvatagger.sh b/scripts/larvatagger.sh index 1156bf286f39d80bad05b9c373aa119b5a009c4c..52e624d5b95b76373ebe22923a0a05064efce864 100755 --- a/scripts/larvatagger.sh +++ b/scripts/larvatagger.sh @@ -22,6 +22,10 @@ for _ in $(seq $#); do shift ;; *) + if [ "$1" = "--no-cache" ]; then + # --no-cache is default for build since 0.16.1 + no_cache=1 + fi # note: if DOCKER_ARGS is externally defined, it must end with an explicit space DOCKER_ARGS="${DOCKER_ARGS}$1 " shift @@ -78,12 +82,15 @@ DOCKER_ARGS="--build-arg BACKEND=${1:15} $DOCKER_ARGS"; shift TARGET=backend elif [ "$1" = "--no-cache" ]; then echo "Deprecation warning: argument $1 should now be passed before build" -DOCKER_ARGS="--no-cache $DOCKER_ARGS"; shift +shift else echo "argument not supported: $1"; shift exit 1 fi done +if [ -z "$no_cache" ]; then + DOCKER_ARGS="--no-cache $DOCKER_ARGS" +fi DOCKER_ARGS="--target $TARGET $DOCKER_ARGS" if [ "$BUILD" == "--dev" ]; then if ! [[ "$LARVATAGGER_IMAGE" == *:* ]]; then LARVATAGGER_IMAGE="${LARVATAGGER_IMAGE}:dev"; fi @@ -204,8 +211,14 @@ eval $DOCKER_RUN predict) +if [ "$(basename "$(dirname "$1")")" = "**" ]; then +parentdir=$(cd "$(dirname "$(dirname "$1")")"; pwd -P) +data_file=$(basename "$(dirname "$1")")/$(basename "$1") +else parentdir=$(cd "$(dirname "$1")"; pwd -P) -data_file=$(basename "$1"); shift +data_file=$(basename "$1") +fi +shift RUN_ARGS="$RUN_ARGS -v \"$parentdir\":/data" diff --git a/src/cli_toolkit.jl b/src/cli_toolkit.jl index 371d4a44047ef962d056504d6820deacfa061f54..82a00be34159ba3519c59d0131a40f663ff5c5b0 100644 --- a/src/cli_toolkit.jl +++ b/src/cli_toolkit.jl @@ -3,7 +3,7 @@ module Toolkit using DocOpt using Pkg using OrderedCollections -using PlanarLarvae, PlanarLarvae.Datasets, PlanarLarvae.Formats +using PlanarLarvae, PlanarLarvae.Datasets, PlanarLarvae.Formats, PlanarLarvae.Dataloaders include("Taggers.jl") using .Taggers @@ -191,10 +191,14 @@ function main(args=ARGS; exit_on_error=true) if endswith(datapath, ".txt") # assume that the file lists paths to data files to be processed; # in this case, the path to the txt file is not relevant + @info "The listed data file paths are expected to be relative to current directory" cwd=pwd() pwd() else dirname(datapath) end + elseif occursin("*", datapath) + repository = Dataloaders.Repository(datapath) + repository.root else datapath end diff --git a/src/files.jl b/src/files.jl index 5401ee2b6a7985f09c7528e1e2cdf6d9c80cb011..bde0c9c763a295ed54564ac2790c1143c96661da 100644 --- a/src/files.jl +++ b/src/files.jl @@ -408,7 +408,7 @@ function explicit_editions_needed(controller, editiontag) file = preload(originalfile) if file isa Formats.JSONLabels Formats.load!(file) - return haskey(file.run, :labels) + return haskey(file.run.attributes, :labels) elseif file isa Formats.Trxmat return true else