Commit edc6c4ab authored by Andrey Filippov's avatar Andrey Filippov

CLAUDE: scene list points at the test manifest - SET casesFile support

The scene-sequence .list is the single source of truth: it now carries
SET casesFile lists/cases.list (relative to rootDirectory, the
EyesisCorrectionParameters rule). run_cases.sh discovery order: -c arg ->
the scene list's SET casesFile (when -x/-l provides the list; explicit
pointer, missing target = hard error) -> convention lookup under
rootDirectory -> repo-local gitignored link. Verified: -l, -x and bare
modes all resolve to the same manifest/model.

Java companion (imagej-elphel): casesFile added to KEY_DIRS (index 12,
file-exempt from the auto-mkdirs) so the SET parses cleanly.
Co-Authored-By: 's avatarClaude Fable 5 <noreply@anthropic.com>
parent 5b8f2f7a
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
# ln -s <dataRoot>/lists/cases.list cases.list # optional repo-local link # ln -s <dataRoot>/lists/cases.list cases.list # optional repo-local link
# # (gitignored) so a bare # # (gitignored) so a bare
# # ./run_cases.sh finds it # # ./run_cases.sh finds it
# and point the SCENE list at it (the scene list is the single source of
# truth; the key is known to EyesisCorrectionParameters, a file - no mkdirs):
# SET casesFile lists/cases.list # relative to rootDirectory
# #
# SAME CONVENTION as the scene-sequence .list files (lv_*.list): the header is # SAME CONVENTION as the scene-sequence .list files (lv_*.list): the header is
# SET lines, the main body SELECTS cases by uncommenting them. Run with: # SET lines, the main body SELECTS cases by uncommenting them. Run with:
......
...@@ -47,19 +47,26 @@ if [ -n "$corr_xml" ]; then ...@@ -47,19 +47,26 @@ if [ -n "$corr_xml" ]; then
fi fi
# ---- locate the manifest (data-specific, lives under the data root) ---- # ---- locate the manifest (data-specific, lives under the data root) ----
scene_list_root() { # rootDirectory from a scene list scene_list_get() { # $1 = scene list, $2 = key
sed -n "s/^SET[[:space:]]\+rootDirectory[[:space:]]\+\([^#]*\).*/\1/p" "$1" | tail -1 | sed 's/[[:space:]]*$//;s|/$||' sed -n "s/^SET[[:space:]]\+$2[[:space:]]\+\([^#]*\).*/\1/p" "$1" | tail -1 | sed 's/[[:space:]]*$//'
} }
if [ -z "$CASES" ]; then if [ -z "$CASES" ] && [ -n "$list_file" ] && [ -f "$list_file" ]; then
if [ -f "$REPO/cases.list" ]; then # the scene list is the single source of truth: its own SET casesFile wins
CASES="$REPO/cases.list" # local copy or symlink into the data root # (relative -> vs its rootDirectory, the EyesisCorrectionParameters rule)
elif [ -n "$list_file" ] && [ -f "$list_file" ]; then root="$(scene_list_get "$list_file" rootDirectory)"; root="${root%/}"
root="$(scene_list_root "$list_file")" cf="$(scene_list_get "$list_file" casesFile)"
if [ -n "$cf" ]; then
case "$cf" in /*) CASES="$cf";; *) CASES="$root/$cf";; esac
[ -f "$CASES" ] || { echo "run_cases.sh: SET casesFile $cf in $list_file -> $CASES not found" >&2; exit 1; }
else
for c in "$root/lists/cases.list" "$root/cases.list" "$(dirname "$list_file")/cases.list"; do for c in "$root/lists/cases.list" "$root/cases.list" "$(dirname "$list_file")/cases.list"; do
[ -f "$c" ] && { CASES="$c"; break; } [ -f "$c" ] && { CASES="$c"; break; }
done done
fi fi
fi fi
if [ -z "$CASES" ] && [ -f "$REPO/cases.list" ]; then
CASES="$REPO/cases.list" # local copy or symlink into the data root
fi
if [ -z "$CASES" ] || [ ! -f "$CASES" ]; then if [ -z "$CASES" ] || [ ! -f "$CASES" ]; then
echo "run_cases.sh: no cases.list found. Install one under your data root:" >&2 echo "run_cases.sh: no cases.list found. Install one under your data root:" >&2
echo " cp $REPO/cases.list.tmpl <dataRoot>/lists/cases.list (then edit SET lines)" >&2 echo " cp $REPO/cases.list.tmpl <dataRoot>/lists/cases.list (then edit SET lines)" >&2
......
Markdown is supported
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