chore: post-bootstrap-merge cleanup (drop retired symbols, modules, notebooks) - #3
Merged
Merged
Conversation
Maps deprecated functions/modules/notebooks against the current SEG and NOSEG production pipelines. Tier 1 (zero-risk): _legacy_dense_compute_npmi, 4 stitching wrappers, spatial_kernel.py, lung_cancer_npmi.ipynb. Tier 2: legacy_workflow.ipynb. Tier 3 (conditional): tiling.py + breast_cancer_npmi.ipynb. All candidates verified by direct grep across src/tests/tutorials/benchmarks (0 external callers). Confirms plot.py, cc_scoring.py, density_cascade.py remain active. Six-commit execution order included. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The dense G**2 NPMI implementation was retired with the move to compute_pmi_bootstrap; only kept for one-off comparisons. Zero callers across src/, tests/, tutorials/, benchmarks/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ling, retired notebooks Bulk removal per docs/superpowers/plans/2026-06-02-post-bootstrap-cleanup.md tiers T1.2-T3.1 (all zero-caller, verified against current SEG/NOSEG pipelines): - src/tracer/stitching.py: 4 deprecated wrappers (coherence_C_from_genes, coherence_C_from_genes_relu, deltaC_between_clusters, deltaC_between_clusters_relu) emitting DeprecationWarning with zero remaining callers. - src/tracer/spatial_kernel.py: orphan module, zero inbound references. Drops tests/test_spatial_kernel.py with it (test module itself imports torch_geometric and never ran in the metrics test env). - src/tracer/tiling.py: only caller was tutorials/breast_cancer/breast_cancer_npmi.ipynb, which is retired. - tutorials/lung_cancer/lung_cancer_npmi.ipynb: zero external references. - tutorials/lung_cancer/legacy_workflow.ipynb + the descriptive bullet in algorithmic_changes.ipynb that pointed at it. - tutorials/breast_cancer/breast_cancer_npmi.ipynb: confirmed retired. src/tracer/__init__.py: drops the matching re-exports (metis_partition_cells, build_metis_partition_hulls, plot_metis_partitions, plot_metis_hulls, chunk_transcripts; coherence_C_from_genes, coherence_C_from_genes_relu, deltaC_between_clusters, deltaC_between_clusters_relu). Tests: 41 passed (no regressions vs the pre-change baseline). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
core.py was re-importing the four deprecated stitching wrappers that the previous commit deleted, so the package failed to load with ImportError. No __all__ discipline + no external 'from tracer.core import <wrapper>' callers (verified by grep), so removal is API-clean. Caught by running run_segmented_pipeline + run_noseg_pipeline on a 50µm ROI of lung_cancer data across both branches: - SEG: md5(core-refactor) == md5(cleanup), 383/383 tx labels match - NOSEG: md5(core-refactor) == md5(cleanup), 383/383 tx labels match The bit-equivalence proof the static grep couldn't give. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Removes deprecated/retired code that the current SEG and NOSEG pipelines no longer reference. Net +166 / −5,856 lines across
src/tracer/, tests, and tutorials.Plan + rationale:
docs/superpowers/plans/2026-06-02-post-bootstrap-cleanup.mdWhat's removed
_legacy_dense_compute_npmi(metrics.py, ~150 lines)RETIREDin docstring; 0 callerscoherence_C_from_genes,coherence_C_from_genes_relu,deltaC_between_clusters,deltaC_between_clusters_relu)DeprecationWarning; 0 callerssrc/tracer/spatial_kernel.py+ its testtutorials/lung_cancer/lung_cancer_npmi.ipynbtutorials/lung_cancer/legacy_workflow.ipynb+ the bullet pointing at it inalgorithmic_changes.ipynbtutorials/breast_cancer/breast_cancer_npmi.ipynb+src/tracer/tiling.py(paired; tiling's only consumer was that notebook)run_breast_cancer.py; the NPMI notebook is retiredsrc/tracer/core.py— drop 4 stale imports of the removed stitching wrappersPublic API: 4 stitching wrapper names + 5 tiling export names drop from
tracer/__init__.py. No externalfrom tracer.core import …/from tracer import …consumer of any removed name was found insrc/,tests/,tutorials/, orbenchmarks/.Bit-equivalence proof
Pipeline outputs on a 50 µm ROI of
lung_cancer_df.parquet(center (1800, 2200), 383 transcripts, 36 input cells) viarun_segmented_pipeline/run_noseg_pipeline:bd239c4)6df0f6cd…6df0f6cd…3d338f1c…3d338f1c…DataFrame.equals()=Truefor both; every transcript lands on the same final entity.Test plan
pytest tests/test_pmi_bootstrap.py→ 41/41 pass (no regressions on the metrics test suite that runs in the lightweight env).run_segmented_pipeline+run_noseg_pipelineon a 50 µm ROI of lung_cancer data — bit-identical per-transcript output across branches (md5 +DataFrame.equals()).test_pipeline_smoke,test_pipeline_regression,test_pipeline_tiled,test_phase1_*) — these require the full torch_geometric / open3d / geopandas stack; running them on CI gives the broader regression check.Commits
🤖 Generated with Claude Code