Remove the spread model from ShapePipe - #911
Merged
Merged
Conversation
save_sm_data returned the n_obj argument it was given instead of the number of rows it actually saved, so the runner's SExtractor-vs- spread-model size check compared a value with itself and could never detect a mismatch. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014bvNTrAmZxcfb1ee83ApPK
… logging - The size-mismatch warning called w_log(...) directly; w_log is a logger, not a callable, so a real mismatch crashed instead of being reported. Use w_log.warning(...), matching other runners, and fix the malformed message. - With no spread-model input, the runner logged "setting spread model to 99" but wrote no SPREAD_MODEL column at all. The log now says what actually happens; behaviour for the committed three-input path (SM_DO_CLASSIFICATION off) is unchanged. - SM_DO_CLASSIFICATION = True with no spread-model input is now a config error (there is nothing to classify on), raised clearly instead of being silently ignored. - A missing SM_STAR_THRESH/SM_GAL_THRESH under classification now raises a clear ValueError instead of a bare configparser.NoOptionError. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014bvNTrAmZxcfb1ee83ApPK
…cat_runner One test per defect fixed in make_cat_runner/save_sm_data, each verified to fail against the pre-fix code and pass after: save_sm_data returning its true saved count, the size-mismatch warning logging without crashing, honest no-input logging with no SPREAD_MODEL column written (matching the committed three-input path), refusing SM_DO_CLASSIFICATION without a spread-model input, and a clear error for a missing SM_STAR_THRESH/SM_GAL_THRESH. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014bvNTrAmZxcfb1ee83ApPK
- The classification-without-input test never wrote its ngmix catalogue, so on the pre-fix code it failed with catalogueFileNotFound instead of exercising the intended assertion. It now writes a matching ngmix catalogue and fails with "DID NOT RAISE ValueError" against the pre-fix runner, confirmed locally. - Single-field structured arrays (NUMBER only) get collapsed by FITSCatalogue._save_to_fits into one row with a vector-valued column whenever save_sextractor_data re-saves them, so every SExtractor-like fixture now carries a second scalar field (_numbered_data) and tests assert the NUMBER column comes back as scalar ids matching the input. - Present tense throughout: docstrings describe what each test protects, not the prior buggy behaviour; the section heading drops the branch-name reference. - New tests grouped under TestSpreadModelPathDefects so a concurrent append to this file's end (PR #854) merges as one class-sized block. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014bvNTrAmZxcfb1ee83ApPK
cailmdaley
marked this pull request as ready for review
September 26, 2026 12:20
Contributor
Author
|
this PR seems straightforward and mergeable, but @martinkilbinger should should spread-model classification really be off? should we flip |
Contributor
Author
|
Martin says spread model classification is unnecessary and can be totally removed. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The spread-model star/galaxy classifier did not work reliably when last run and separates stars from galaxies worse than the downstream (sp_validation, size-based) classification, so ShapePipe no longer computes or carries it. - Delete spread_model_runner and spread_model_package. - make_cat_runner takes exactly three inputs (tile sexcat, galaxy PSF, ngmix); save_sm_data and the SM_DO_CLASSIFICATION / SM_STAR_THRESH / SM_GAL_THRESH keys are gone, along with the tests of that path. - Drop SM_DO_CLASSIFICATION from the committed and image-sims make_cat configs and the SPREAD_* columns from final_cat.param and example/unions_800/cat_matched.param; tidy docs and refs.bib. - astra.yaml: star_galaxy_classification is now [HARDCODED]; the spread_model_inline option is excluded, with the reasons. - A make_cat_runner end-to-end test checks every detection is kept with no classification column. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve tests/module/test_make_cat.py by keeping both the make_cat_runner end-to-end test (no spread-model column) and #854's metacal-flag tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uemfjv9ybCwtKtprksZbVY
Contributor
Author
|
LGTM |
cailmdaley
added a commit
that referenced
this pull request
Sep 28, 2026
… feat/wire-external-masks Resolved by keeping develop's side everywhere #879's pre-squash content conflicted, then re-applying this branch's own changes (a846e08..dc11dab): - astra.yaml: the mask-cut decision moves into the masking sub-analysis as masking.mask_default_cut, in the #875 format (no Anchor sentence; the make_cat contract tag cites it). masking.sky_mask_application now selects catalogue_columns, since the committed config sets MASK_EXT_PATHS; config_tile_Mc.ini's MASK_EXT_PATHS carries its tag. universes pinned. - cfis_image_sims/config_tile_Mc.ini: rebuilt from develop's cfis copy (spread model gone), still without MASK_EXT_PATHS or per-epoch slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cailmdaley
added a commit
that referenced
this pull request
Sep 28, 2026
… feat/retire-versioning Resolved by keeping develop's side where #879's pre-squash content conflicted, then re-applying this branch's own changes (a846e08..bfb7efc). Two by hand: docs/source/pipeline_canfar.md stays retired (develop's one-line path fix goes with it), and the rebuilt tutorial drops the spread-model step that #911 removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cailmdaley
added a commit
that referenced
this pull request
Sep 28, 2026
Brings in #879 (campaign merges), #911 (spread model removed), #854, #905 and #923. - run_config: input_types:/machines: table resolver kept; develop's required `run:` and unresolved-$ check folded in (now over every non-table key). - create_final_cat.read_data keeps develop's raise on a missing column; the branch's skip-missing path is dropped (final_cat_merge is the one producer of final_cat_<run>.hdf5). - final_cat.param carries both NUMBER and TILE_UNIQUE_ID. - DAG tests follow the committed tile_detection default (data plans tile_get_catalogue); params pin regenerated for the tile_detect switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DksuyF9YrZAwHQeAMXsxp4
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.
Martin's call: the spread model didn't really work when he last ran it, and it separates stars from galaxies worse than the downstream classification (sp_validation's size-based selection), which is what we use. So this PR removes it from ShapePipe rather than fixing it.
Removed
spread_model_runnerandspread_model_package.save_sm_data, the optional fourthsexcat_sminput, and theSM_DO_CLASSIFICATION/SM_STAR_THRESH/SM_GAL_THRESHkeys.make_cat_runnernow takes exactly three inputs: tile sexcat, galaxy PSF and ngmix.SM_DO_CLASSIFICATION = Falsefromworkflow/config/cfis/config_tile_Mc.iniandexample/cfis_image_sims/config_tile_Mc_psfex.ini. TheSPREAD_CLASS/SPREAD_MODEL/SPREADERR_MODELentries are gone fromfinal_cat.param, where they were already commented out, and fromexample/unions_800/cat_matched.param. The docs andrefs.bibno longer mention the spread model.Consumers: the committed chain already ran with three inputs and classification off, so its output catalogue is unchanged. sp_validation
developdoesn't read anySPREAD_*column; its column-migration doc already records their removal. Its last leftovers (a deaddo_spread_modelflag and a docstring) are removed in CosmoStat/sp_validation#364. cs_util has no references.Decision record: in
astra.yaml,catalogue_assembly.star_galaxy_classificationkeepsdeferred_downstream. It is now[HARDCODED](there is no config key anymore), and thespread_model_inlineoption isexcludedfor the two reasons above.universes/committed.yamldoesn't change.astra-tools validatepasses.Tests: the spread-model path tests are replaced by one
make_cat_runnerend-to-end test, which checks that every detection is kept and that no classification column is written. Full suite: 686 passed, 1 skipped. The 2 errors are the known ones intests/cluster/test_star_shear_response.py.The legacy CANFAR scripts (
scripts/sh/job_sp_canfar.bash,init_run_exclusive_canfar.sh) andsummary_params_pre_v2.pyare untouched. They drive the old v1 run layout (run_sp_tile_PsViSmVi,--sm) through configs that are no longer in the repo.Closes #910
— Claude (Opus) on behalf of Cail
🤖 Generated with Claude Code