Restructuring proposal: top-level layout + workflow/paper/scratch division#188
Closed
cailmdaley wants to merge 31 commits into
Closed
Restructuring proposal: top-level layout + workflow/paper/scratch division#188cailmdaley wants to merge 31 commits into
cailmdaley wants to merge 31 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 2, 2026
55d608a to
d4a64e4
Compare
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>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
1 similar comment
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Collaborator
Author
|
Continued as #197 — this PR was closed as a side-effect of a branch rename during cleanup. The work is fully intact and now lives on a single, cleanly-named branch. — Claude on behalf of Cail |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restructuring
sp_validationOne organizing principle — the things you run live at the top — a clean three-way
split between analysis, papers, and scratch, and a modular workflow built for more than one
person.
The shape
Today
cosmo_valis buried insidenotebooks/whilecosmo_inference/is top-level, soyou constantly hunt for where each one lives. The fix: the things a person actually runs
sit side by side at the top, sharing library code in
src/underneath.Division of labor
The boundary is the inputs to a paper figure: everything up to that point is analysis;
the figure itself is presentation.
workflow/— all analysis. Generic, reusable, modular, organized for multiple people.Produces analysis products and diagnostic plots (sp_validation makes many — they go to
results/). The bulk of the work lives here.papers/<paper>/— final-figure assembly only. The figure PDF, colours, layout,recombining data for presentation. Tied to one paper, and may never touch Snakemake.
scratch/<person>/— personal and ad hoc. Experiments and one-off custom workflows.Tracked, because seeing each other's scratch is useful.
How the workflow scales — modular, not monolithic
Nothing in this analysis is computed once: the catalog changed ~20× in the first release
suite, and every paper varies the data vector, covariance, and inference. So the workflow
is parameterized — the rules are shared, the config changes each time. Snakemake's
moduledirective imports the rules under your own config and an outputprefix, and letsyou override any single rule:
One top-level
results/; each run namespaces underresults/<name>/via the prefix, sopeople don't clobber each other. A
--dry-runon each composition is the safety net thatlets the structure grow without silent breakage.
Cleanup
defunct/(quarantined since 2024) and the exploratory 2021–22 notebooks — itall stays in git history.
notebooks/to official demos and tutorials; personal scratchy ones move toscratch/.nbstripoutstrips notebook outputs on commit (therepo's weight today is committed notebook outputs), plus a pre-commit size hook.
mechanical sweep rewrites them (scripts included) to the single repo-relative
results/.The milestone
A suite of PRs, in sequence:
develop. (Sacha)This PR is the proposal only. Implementation follows once the foundation merge lands and
the shape is agreed.
— Claude on behalf of Cail