Problem
chained_eclipse/cli.py computes:
ROOT = Path(__file__).resolve().parents[1]
DEFAULT_CONFIG = ROOT / "config" / "baseline.yaml"
DEFAULT_OUTPUTS = ROOT / "outputs"
Under a non-editable install — exactly what CI does (uv sync --no-editable) and what any pip install chained-eclipse user gets — ROOT resolves to site-packages/. Consequences:
DEFAULT_CONFIG does not exist there, so the CLI is unusable without --config.
- Worse,
run_full() / run_design_only() write optimized_system.yaml into ROOT / "config", i.e. the CLI silently writes YAML into site-packages.
run_fixed_only / run_stability_only fall back to ROOT/config/optimized_system.yaml, which inherits the same breakage.
It only works from a source checkout.
Proposed fix
- Resolve the default config via
importlib.resources, after moving config/baseline.yaml to chained_eclipse/config/baseline.yaml and packaging it as package data — or require --config when the default is missing, with a clear error message rather than a confusing FileNotFoundError.
- Never write into
ROOT / "config". The optimized-system mirror already goes to <output>/optimized_system.yaml; drop the second copy, or gate it behind an explicit --save-config PATH flag.
- Update the
run_fixed_only / run_stability_only fallback to read from the output directory, and document the new lookup order.
Test
A subprocess test that invokes chained-eclipse --help plus a monkeypatched-config smoke path, asserting no writes land outside the temporary output directory.
Scientific impact
None expected — packaging and path resolution only. No solver or geometry code changes.
From the work plan, item P0 / 3. Left unimplemented because the packaging approach (package-data vs. required --config) is a maintainer decision that changes the documented user-facing invocation.
Problem
chained_eclipse/cli.pycomputes:Under a non-editable install — exactly what CI does (
uv sync --no-editable) and what anypip install chained-eclipseuser gets —ROOTresolves tosite-packages/. Consequences:DEFAULT_CONFIGdoes not exist there, so the CLI is unusable without--config.run_full()/run_design_only()writeoptimized_system.yamlintoROOT / "config", i.e. the CLI silently writes YAML into site-packages.run_fixed_only/run_stability_onlyfall back toROOT/config/optimized_system.yaml, which inherits the same breakage.It only works from a source checkout.
Proposed fix
importlib.resources, after movingconfig/baseline.yamltochained_eclipse/config/baseline.yamland packaging it as package data — or require--configwhen the default is missing, with a clear error message rather than a confusingFileNotFoundError.ROOT / "config". The optimized-system mirror already goes to<output>/optimized_system.yaml; drop the second copy, or gate it behind an explicit--save-config PATHflag.run_fixed_only/run_stability_onlyfallback to read from the output directory, and document the new lookup order.Test
A subprocess test that invokes
chained-eclipse --helpplus a monkeypatched-config smoke path, asserting no writes land outside the temporary output directory.Scientific impact
None expected — packaging and path resolution only. No solver or geometry code changes.
From the work plan, item P0 / 3. Left unimplemented because the packaging approach (package-data vs. required
--config) is a maintainer decision that changes the documented user-facing invocation.