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

Merge branch 'dev' into 'main'

Set of commits to be tagged v0.18

See merge request !17
parents 5218c140 a04d7eb2
No related branches found
No related tags found
1 merge request!17Set of commits to be tagged v0.18
Pipeline #123525 passed
......@@ -1037,11 +1037,11 @@ version = "0.3.3"
[[deps.PlanarLarvae]]
deps = ["DelimitedFiles", "HDF5", "JSON3", "LinearAlgebra", "MAT", "Meshes", "OrderedCollections", "Random", "SHA", "StaticArrays", "Statistics", "StatsBase", "StructTypes"]
git-tree-sha1 = "6b2dc28d56bcef101672cbf2bb784bbd5d88d579"
git-tree-sha1 = "d964d040e319fe3bd9140e5bf91d648de6acc96f"
repo-rev = "main"
repo-url = "https://gitlab.pasteur.fr/nyx/PlanarLarvae.jl"
uuid = "c2615984-ef14-4d40-b148-916c85b43307"
version = "0.15.0"
version = "0.16.0"
[[deps.PlotUtils]]
deps = ["ColorSchemes", "Colors", "Dates", "PrecompileTools", "Printf", "Random", "Reexport", "Statistics"]
......
name = "LarvaTagger"
uuid = "8b3b36f1-dfed-446e-8561-ea19fe966a4d"
authors = ["François Laurent", "Institut Pasteur"]
version = "0.17.1"
version = "0.18"
[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
......
......@@ -77,6 +77,7 @@ RUN if [ -z $TAGGINGBACKENDS_BRANCH ]; then \
&& git clone --depth 1 --no-tags --single-branch -b $(echo $BACKEND | cut -d/ -f2) https://gitlab.pasteur.fr/nyx/MaggotUBA-adapter MaggotUBA \
&& cd MaggotUBA \
&& rm -rf .git \
&& (cat requirements.txt | xargs -I % sh -c 'poetry add "%"') \
&& poetry install --only main \
&& poetry add "pynvml==11.4.1" \
&& if [ "$(echo $BACKEND | cut -d/ -f2)" = "main" ] || [ "$(echo $BACKEND | cut -d/ -f2)" = "dev" ]; then \
......
......@@ -173,7 +173,7 @@ docker pull flaur/larvatagger
```
Beware that images that ship with a tagging backend are relatively large files (>5GB on disk).
If you are not interested in automatic tagging, use the `flaur/larvatagger:0.17.1-standalone` image instead.
If you are not interested in automatic tagging, use the `flaur/larvatagger:0.18-standalone` image instead.
### Upgrading
......
......@@ -37,7 +37,7 @@ if ! julia -v &> /dev/null; then
# do NOT use juliaup to install Julia
module load Python &> /dev/null # Maestro
python3 -m pip install jill
python3 -m jill install -v 1.9.1 -c
python3 -m jill install -v 1.10.0 -c
fi
# h5diff (for tests) on Maestro
......@@ -82,7 +82,7 @@ ln -s $(realpath MaggotUBA-adapter) MaggotUBA
# the step below may not be necessary
(cd TaggingBackends && JULIA_PROJECT=$(pwd) poetry run python -c 'import julia; julia.install()')
(cd MaggotUBA && poetry env use python3.8 && poetry install -v && poetry remove taggingbackends && poetry add ../TaggingBackends && scripts/make_models.jl default)
(cd MaggotUBA && poetry env use python3.8 && (cat requirements.txt | xargs -I % sh -c 'poetry add "%"') && poetry install -v && poetry remove taggingbackends && poetry add ../TaggingBackends && scripts/make_models.jl default)
cd LarvaTagger || exit 1
julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.develop(path="../PlanarLarvae")'
......@@ -97,7 +97,7 @@ if [ -f ../../LarvaTagger_test_data.tgz ]; then
# KEEP_MODEL_FILES=1 ./deploy_and_test.sh
# cd LarvaTagger/LarvaTagger.jl
# rm -rf test/data/test_train_*
# cp -ra ../MaggotUBA/models/test_train_* test/data/
# cp -Rp ../MaggotUBA/models/test_train_* test/data/
# tar zcvf LarvaTagger_test_data.tgz test/data/*
# mv LarvaTagger_test_data.tgz ../../
tar zxvf ../../LarvaTagger_test_data.tgz
......
......@@ -50,9 +50,10 @@ endTest() {
prepareTestData() {
tmpdir="$SHUNIT_TMPDIR/$1"
shift
rm -rf "$tmpdir"
mkdir -p "$tmpdir"
for file in sample.spine sample.outline; do
for file in sample.spine sample.outline $@; do
cp "$datapath/$file" "$tmpdir/" || exit 1
done
echo $tmpdir
......@@ -123,6 +124,33 @@ testPredictDefault() {
endTest
}
# requires: sample.spine sample.outline trx.mat original_predictions.label test_train_default/predicted.label
testPredictWithConflictingInput() {
tagger="test_train_default$tagger_suffix"
# make test data
touch "$datapath/spurious.txt"
tmpdir=$(prepareTestData $tagger trx.mat original_predictions.label spurious.txt)
# restore the model
mkdir -p "$maggotuba/models"
rm -rf "$maggotuba/models/$tagger"
echo "cp -Rp \"$datapath/$tagger\" \"$maggotuba/models/\""
cp -Rp "$datapath/$tagger" "$maggotuba/models/"
[ -f "$maggotuba/models/$tagger/clf_config.json" ] || exit 1
# run
cd "$project_root"
echo "\"$larvataggerjl\" predict \"$maggotuba\" $tagger \"$tmpdir\" --debug"
"$larvataggerjl" predict "$maggotuba" $tagger "$tmpdir" --debug
# compare
filename=predicted.label
predictions="$tmpdir/$filename"
expected_labels="$datapath/$tagger/$filename"
assertFalse "\`predict\` failed to generate file $filename" '[ -z "$predictions" ]'
assertTrue "\`predict\` failed to reproduce file $filename" '$(cmp "$expected_labels" "$predictions")'
# clean up
rm -f "$datapath/spurious.txt"
endTest
}
# requires: sample.spine sample.outline original_predictions.label test_train_default/*
testTrainDefault() {
tagger="test_train_default$tagger_suffix"
......@@ -238,7 +266,7 @@ postTrain() {
assertTrue "\`train\` failed to reproduce file $enc_weights" '$(cmp "$expected_tagger_dir/$enc_weights" "$enc_weights_path")'
assertTrue "\`train\` failed to reproduce file $enc_config" '$(cmp "$expected_tagger_dir/$enc_config" "$enc_config_path")'
assertTrue "\`train\` failed to reproduce file $clf_weights" '$(cmp "$expected_tagger_dir/$clf_weights" "$clf_weights_path")'
assertTrue "\`train\` failed to reproduce file $clf_config" '$(cmp "$expected_tagger_dir/$clf_config" "$clf_config_path")'
assertTrue "\`train\` failed to reproduce file $clf_config" '[ -z "$(diff "$expected_tagger_dir/$clf_config" "$clf_config_path" | grep -E "^[<>] " | grep -vE larva_dataset_.*[.]hdf5)" ]'
# test the predictions
echo "\"$larvataggerjl\" predict \"$maggotuba\" $tagger \"$tmpdir/sample.spine\""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment