Problem
StorageSettings.base_path defaults to a Windows drive path:
# gently/settings.py:73
base_path: Path = field(default_factory=lambda: _env("STORAGE_PATH", Path("D:/Gently3")))
On Windows (the microscope PCs) this is correct — D: is the dedicated data drive. But off-Windows (Linux dev boxes, macOS, CI), Path("D:/Gently3") is not an absolute path. It resolves relative to the cwd, so a default-config run silently creates a junk directory literally named D: and writes session data into it.
PR #51 added D:/ to .gitignore, which hides the symptom but doesn't stop the app from writing to a nonsense location.
Actual fix
Make the default platform-aware so Windows is untouched and everywhere else gets a real absolute path:
def _default_storage_path() -> Path:
if os.name == "nt":
return Path("D:/Gently3")
xdg = os.environ.get("XDG_DATA_HOME")
base = Path(xdg) if xdg else Path.home() / ".local" / "share"
return base / "Gently3"
# ...
base_path: Path = field(default_factory=lambda: _env("STORAGE_PATH", _default_storage_path()))
- Windows production behavior is identical.
GENTLY_STORAGE_PATH override is unchanged.
- The
.gitignore D:/ entry becomes unnecessary (can be left as a stopgap).
Out of scope / follow-up
Other hardcoded D:/... defaults exist in legacy/script modules and could later route through settings.storage.base_path:
gently/dataset/aggregator.py, embryo_dataset.py:164, schema.py:24 (DEFAULT_DB_PATH)
benchmarks/perception/runner.py:493, diagnostics/segment_embryo_nuclei.py:57
Notes
Behavior change on non-Windows defaults → land as its own PR against development, not folded into release #51.
Problem
StorageSettings.base_pathdefaults to a Windows drive path:On Windows (the microscope PCs) this is correct —
D:is the dedicated data drive. But off-Windows (Linux dev boxes, macOS, CI),Path("D:/Gently3")is not an absolute path. It resolves relative to the cwd, so a default-config run silently creates a junk directory literally namedD:and writes session data into it.PR #51 added
D:/to.gitignore, which hides the symptom but doesn't stop the app from writing to a nonsense location.Actual fix
Make the default platform-aware so Windows is untouched and everywhere else gets a real absolute path:
GENTLY_STORAGE_PATHoverride is unchanged..gitignore D:/entry becomes unnecessary (can be left as a stopgap).Out of scope / follow-up
Other hardcoded
D:/...defaults exist in legacy/script modules and could later route throughsettings.storage.base_path:gently/dataset/aggregator.py,embryo_dataset.py:164,schema.py:24(DEFAULT_DB_PATH)benchmarks/perception/runner.py:493,diagnostics/segment_embryo_nuclei.py:57Notes
Behavior change on non-Windows defaults → land as its own PR against
development, not folded into release #51.