Skip to content

Path-rooted sub-analysis recipes execute from project root, breaking sub-analysis-relative paths #152

@lhparker1

Description

@lhparker1

What happened

Recipes in a path-rooted sub-analysis execute from the project root, but lc init scaffolds a per-sub-analysis scripts/ dir and the engine renders {output} as root-relative (e.g. analyses/reconstruction/results/<universe>/<output_id>). A recipe authored the natural way — python scripts/run_reconstruction.py, with the script reading cwd-relative paths like ../../data/... — fails because there is no scripts/ at the project root and the relative data path does not resolve. The scaffold/docs treat a sub-analysis as a self-contained unit (cwd = the sub-analysis dir), but the executor runs every recipe from the project root with no cd into the analysis_path.

Error

python: can't open file '<project_root>/scripts/run_reconstruction.py': [Errno 2] No such file or directory

Reproduction

  1. Create a path-rooted sub-analysis (analyses/<name>/ with its own astra.yaml and scripts/).
  2. Author a recipe: command: python -u scripts/foo.py --output {output}.
  3. lc run <name>.<output_id> from the project root.
  4. Resolved command runs from project root: the script path and any cwd-relative reads (../../data/...) fail.

The engine renders {output} root-relative (analyses/<name>/results/...) yet runs from the project root — internally inconsistent with sub-analysis-relative authoring.

Suggested resolution: either cd into the path-rooted sub-analysis dir and render {output} relative to it, or document/scaffold that ALL recipe paths must be project-root-relative.

Environment

  • ASTRA (astra-spec): 0.0.7
  • lightcone-cli: 0.3.0
  • Python: 3.11.14
  • OS: Linux 6.4.0 (NERSC Perlmutter)

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions