Skip to content

Restructuring: top-level layout + workflow/papers/scratch division#197

Draft
cailmdaley wants to merge 31 commits into
developfrom
cleanup/restructuring
Draft

Restructuring: top-level layout + workflow/papers/scratch division#197
cailmdaley wants to merge 31 commits into
developfrom
cleanup/restructuring

Conversation

@cailmdaley
Copy link
Copy Markdown
Collaborator

Restructuring sp_validation

Supersedes #188 — that PR was closed as a side-effect of a branch rename during cleanup; all work is intact on this branch (the PR was only a wrapper, no commits were lost). This is the same line of work on a single, cleanly-named branch.

Status — WIP draft, not yet for review. One organizing principle: the things you run live at the top level, sharing library code in src/ underneath — plus a clean workflow/ (analysis) ↔ papers/ (final-figure assembly) ↔ scratch/ (personal) split.

Landed so far (Phase 0–1)

  • Foundation folded in — Sacha's sachaguer:develop (Merge Sacha's fork with fiducial sp_validation #192 head, 120 files: paper plots, harmonic configs, library changes) merged; the cosmology.py KeyError: 'mnu' blocker fixed (one line) — test_cosmology.py 26/26 green. Sacha's broad .gitignore bans were rejected toward develop's patterns.
  • Back-pressure suite, before any file moves — characterization guards that must stay green as files move. Guard ① (imports + standalone scripts/ resolution) is green (tests/test_imports.py, 42 passed / 1 xfailed — and it already caught a dead script). Guards ② (snakemake -n passes), ③ (Candide-local config-path existence), ⑤ (symlink integrity), ⑥ (dangling-reference grep) are in progress.
  • develop is untouched.

Next

Phase 2 — the actual top-level moves (workflow/, papers/, scratch/) proceed in small git mv steps behind the green guards. The full plan and live state are tracked in the sp-validation-restructuring fiber.

— Claude on behalf of Cail

sachaguer and others added 30 commits March 3, 2026 15:55
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fold Sacha's pending foundation (PR #192 head, sachaguer:develop @ c22f075)
onto current develop so the restructuring builds on his foundation without
racing his merge gesture (Cail's direction, 2026-06-05).

.gitignore conflict resolved in favour of develop: kept the .felt tracking
block, rejected sacha's broad cluster bans (*.png *.sh *.fits *.out *.err) —
those get narrowed during the restructuring gitignore pass, not adopted
wholesale. cosmo_val.py / cat_config.yaml auto-merged cleanly (origin's
docstring-RST polish + sacha's functional changes did not collide).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cosmology.py get_cosmo read planck_defaults["mnu"] but the dict never
defined the key, so every bare get_cosmo() call (no ccl_params, no mnu
arg) raised KeyError: 'mnu'. Add "mnu": PLANCK18["m_nu"] (0.06 eV).

Verified: test_cosmology.py 26/26 pass (was immediate KeyError before).
This is the one blocker that kept Sacha's foundation from running clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
docs/source/sp_validation.*.rst are regenerated on every docs build by
sphinx-apidoc (deploy-docs.yml: `sphinx-apidoc -feTMo docs/source
src/sp_validation`), matching the already-ignored fortuna.*/scripts.*
stubs — they should never be committed.

uv.lock: the container is the canonical runtime (CLAUDE.md), the lockfile
has never been tracked, so ignore it rather than make an unowned
pinned-dep commitment. One-line flip to track if we decide to pin.

Establishes a clean base for the restructuring branch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sacha's branch removed the cosmosis_pipeline_glass_mock_0*.ini and
_v0*.ini ignore patterns, which un-ignored ~700 generated glass-mock
pipeline configs in cosmo_inference/cosmosis_config/. Restore the two
specific patterns (not broad bans) so the tree returns to develop's
clean state. These are generated artifacts, never tracked.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
First guard in the restructuring invariant suite (sp-validation-restructuring
fiber). A pure file-move must not break imports; this is the first thing to go
red on a bad git mv. Two halves, because scripts live OUTSIDE the package and a
package-only walk misses them (the gap the ngmix review's test_scripts_import
flagged):

- Package modules (src/sp_validation/*.py): real import — library code is
  import-safe, so a broken cross-module reference fails immediately.
- Standalone scripts (scripts/*.py): NOT executed (several do work at module
  level; one isn't a valid module name). Parsed with ast — which also asserts
  syntactic validity — and every first-party (sp_validation.*) import target
  resolved via importlib.util.find_spec.

Green baseline: 42 passed, 1 xfailed. The xfail is a real find — plot_leakage.py
imports `from sp_validation.correlation import *`, a module that never existed
(dead LF-leakage script). Marked xfail(strict=True) + KNOWN_BROKEN_SCRIPTS so
the baseline is honest and the strict-xfail flips the moment it's fixed/deleted;
triage belongs to the scripts/ curation pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants