Remove hardcoded /home/gg paths so the project is portable

Notebooks now use Path.home() / "cupido" for the repo root (works for
any user inside the JupyterLab container), and the offline-tracking
scripts read the ethoscope source-tree location from the new
ETHOSCOPE_SRC config constant — defaulting to ~/Code/ethoscope_project/...
and overridable via the ETHOSCOPE_SRC environment variable.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Giorgio Gilestro 2026-05-01 08:55:44 +01:00
parent 5934dce21e
commit 231c7a437f
8 changed files with 25 additions and 14 deletions

View file

@ -1,5 +1,6 @@
"""Shared path constants for the Cupido tracking project."""
import os
from pathlib import Path
# Where this code repository lives (the directory containing scripts/, notebooks/, ...).
@ -13,9 +14,9 @@ LOGS_DIR = PROJECT_ROOT / "data" / "logs"
# Where the source videos live (read-only NFS mount).
VIDEOS_ROOT = Path("/mnt/ethoscope_data/videos")
# Where the project's bulky data lives — outside the ownCloud-synced repo so
# it doesn't churn the cloud sync. This single root holds everything that's
# big or regenerable: tracking DBs, target-point JSONs, and the metadata
# Where the project's bulky data lives — outside the cloud-synced repo so
# it doesn't churn the sync. This single root holds everything that's big
# or regenerable: tracking DBs, target-point JSONs, and the metadata
# spreadsheet (xlsx + TSV).
DATA_VOLUME = Path("/mnt/data/projects/cupido")
TARGETS_DIR = DATA_VOLUME / "targets"
@ -25,3 +26,13 @@ VIDEO_INFO_TSV = DATA_VOLUME / "all_video_info_merged.tsv"
# A small CSV listing every video file we know about (built locally).
INVENTORY_CSV = DATA_METADATA / "video_inventory.csv"
# Where the ethoscope source tree is checked out (used by track_videos.py
# and auto_detect_targets.py — host-side scripts that import ethoscope
# from a local clone rather than from pip). Default assumes the standard
# layout `~/Code/ethoscope_project/ethoscope/src/ethoscope`; override with
# the ETHOSCOPE_SRC environment variable if your clone lives elsewhere.
ETHOSCOPE_SRC = Path(os.environ.get(
"ETHOSCOPE_SRC",
str(Path.home() / "Code" / "ethoscope_project" / "ethoscope" / "src" / "ethoscope"),
))