Skip to content

Prepare the legacy group-data stack for deletion (markers, warnings, gds parity) - #262

Open
bbuchsbaum wants to merge 6 commits into
masterfrom
claude/legacy-group-deletion-prep
Open

bbuchsbaum wants to merge 6 commits into
masterfrom
claude/legacy-group-deletion-prep

Conversation

@bbuchsbaum

@bbuchsbaum bbuchsbaum commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

This prepares the deletion of the legacy group_data_csv / _h5 / _nifti stack in the next minor release, without removing anything yet. When that release comes, the deletion becomes mechanical: delete every site marked LEGACY-GROUP-DELETE (next minor) (grep -rn LEGACY-GROUP-DELETE R src tests vignettes lists 60), then regenerate docs. The step-by-step checklist is in data-raw/simplification-2026-10-plan.md, section "Legacy group-data deletion checklist".

Changes

  • Markers. Every function, branch and helper that exists only for the legacy stack is marked: 28 sites in R/, 2 in src/.

    • The set comes from the call graph: functions reachable only from the deprecated entry points.
    • It covers three whole files (R/group_data_{csv,h5,nifti}.R).
    • In other files: 7 functions in fmri_meta.R, 6 legacy group_data methods, ols_t_cpp() / welch_t_cpp(), and legacy branches in fmri_meta_methods.R, fmri_ttest_helpers.R and group_data_gds.R.
    • The in-memory list(blocks =) form and paired_diff_block() are not legacy and stay unmarked.
  • Deprecation warnings. Every public legacy entry point now warns:

    • newly: the accessors extract_csv_data(), get_rois(), get_contrasts(), read_h5_full() and read_nifti_full();
    • newly: fmri_meta() on group_data_nifti data, and fmri_ttest() on any legacy file-backed object;
    • already warning: the constructors and the other legacy fmri_meta methods.

    Internal legacy reads go through .legacy_group_quiet(), so users see one warning, not several. options(fmrireg.suppress_deprecation = TRUE) silences them, as before.

  • gds now does what the legacy CSV reader did, so deleting it loses nothing:

    • fmri_meta() on data whose samples aren't a voxel grid (ROI tables, parcels) returns an fmri_meta_roi fit. tidy() gives one row per ROI, print() reports ROIs, and spatial_fdr() groups by ROI.
    • group_data(format = "csv") on a table without an ROI column treats it as one ROI, "overall". It used to stop.
    • New summary.group_data_gds(). summary() on gds data used to fall through to the legacy method.
  • Demos and docs.

    • .demo_group_data() (gds) backs the live examples and .demo_fmri_meta().
    • The legacy .demo_group_data_csv() is kept only for the legacy accessors' examples, and is marked.
    • t_to_beta_se() moved to R/metafuns.R, so the three legacy files can be deleted whole.
    • NEWS has a "Deprecations" section, and the a_09 vignette note is updated.
  • Tests (37 files).

    • Tests that only exercise legacy code are marked: 4 whole files, plus blocks in 17 others. The checklist lists them.
    • Tests of live features that used legacy objects as input now build gds data and keep their assertions. This covers the review-B weight and estimator tests against t.test / lm / metafor, the meta CSV closed forms, fmri_ttest on NIfTI, write_results by-stat outputs, contrasts, print/summary and tidy().
    • test-simplify-2026-10-P1.R now expects ROI-table fits to be fmri_meta_roi with n_rois.

Testing

  • New tests/testthat/test-simplify-2026-10-legacy-prep.R covers the three gds behaviours above against closed-form IVW estimates. All three tests fail on master.
  • Full suite: 0 failures apart from the known 5 in test-review-E-cli.R, an artifact of running every file in one process; that file passes on its own. 8,622 passing.

Left for the deletion PR

Follow the checklist. Every public entry point now warns, so the next minor release can delete the stack.


Generated by Claude Code


Note

Medium Risk
Changes group-analysis dispatch, fit object classes (fmri_meta_roi), and deprecation warnings across meta/ttest paths; deletion is deferred but user-visible behavior on gds ROI tables and summary() shifts to match legacy CSV semantics.

Overview
This PR prepares removal of the legacy group_data_csv / _h5 / _nifti stack in the next minor release without deleting it yet. Sites slated for deletion are tagged LEGACY-GROUP-DELETE (next minor), and a full checklist lives in data-raw/simplification-2026-10-plan.md.

Deprecation plumbing: New .legacy_group_deprecated() / .legacy_group_quiet() warn on public legacy entry points (extract_csv_data(), get_rois(), get_contrasts(), read_h5_full(), read_nifti_full(), fmri_meta() on group_data_nifti, fmri_ttest() on file-backed legacy objects) while internal legacy reads stay quiet. NEWS documents the upcoming removals and options(fmrireg.suppress_deprecation).

GDS parity with the old CSV reader so behavior is preserved after deletion: fmri_meta() on non–voxel-grid samples returns fmri_meta_roi (n_rois, per-ROI tidy() / spatial_fdr()); tabular group_data(format = "csv") without an ROI column becomes a single "overall" ROI; summary.group_data_gds() stops dispatching to the legacy summary.group_data().

Demos and tests switch live examples to .demo_group_data() (gds); t_to_beta_se() moves to R/metafuns.R. Many tests build gds fixtures instead of legacy constructors, with new test-simplify-2026-10-legacy-prep.R locking the three gds behaviors above.

Reviewed by Cursor Bugbot for commit a4dfc27. Bugbot is set up for automated code reviews on this repo. Configure here.

Every function, branch and helper that exists only for the legacy
group_data_csv/_h5/_nifti stack carries a LEGACY-GROUP-DELETE (next minor)
marker (derived from the call graph: reachable only from the deprecated
entry points), and data-raw/simplification-2026-10-plan.md has the deletion
checklist. The accessors extract_csv_data(), get_rois(), get_contrasts(),
read_h5_full(), read_nifti_full(), fmri_meta() on group_data_nifti and
fmri_ttest() on legacy file-backed objects now emit deprecation warnings
(.legacy_group_deprecated(); internal legacy reads use .legacy_group_quiet()
so users see one warning). .demo_group_data() is the gds demo used by the
live examples and .demo_fmri_meta(); t_to_beta_se() moved to metafuns.R so
the three legacy files can be deleted whole.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFokJuZ18Chw2tkkMDvz4x
…ests to gds

Blocks testing legacy constructors, readers, validators and legacy branches
carry LEGACY-GROUP-DELETE markers; blocks testing live features (meta
estimators, contrasts, print/summary, coef_image, save-by-stat, spatial FDR,
fmri_ttest) now build gds group data and keep their assertions. The tidy()
per-ROI test stays on legacy input (NEEDS MIGRATION: gds ROI fits are not
fmri_meta_roi).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFokJuZ18Chw2tkkMDvz4x
…ests to gds

ols_t_cpp()/welch_t_cpp() deprecation tests and legacy-vs-gds parity tests
carry LEGACY-GROUP-DELETE markers; live tests (fit-time contrasts, ttest
mc/contrasts, write_results by-stat outputs, demos, gds bridges) now build
gds group data with the same assertions. One legacy-only assertion in the
ttest error-gate block is marked inline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFokJuZ18Chw2tkkMDvz4x
So the legacy stack can go without losing behaviour:
- fmri_meta() on gds data whose samples are not a voxel grid (ROI tables,
  parcels) returns an fmri_meta_roi fit (tidy() per ROI, print() reports
  ROIs, spatial_fdr() groups by ROI), as legacy csv fits did;
- group_data(format = "csv") on a table without an ROI column treats it as
  one ROI, "overall" (it stopped);
- summary.group_data_gds(), so summary() on gds data no longer falls
  through to the legacy summary.group_data().
New tests in test-simplify-2026-10-legacy-prep.R fail on master. The tidy()
test in test-group_analysis.R is migrated, and test_fmri_meta_csv.R keeps
its fmri_meta_roi / n_rois assertions on gds input.

Group B tests: legacy-only blocks marked LEGACY-GROUP-DELETE; review-B
meta-weight and estimator tests (vs t.test, lm, metafor), csv meta tests and
NIfTI ttest/meta tests migrated to gds input with their assertions kept.
The deletion checklist now lists the test files and blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFokJuZ18Chw2tkkMDvz4x
@cursor

cursor Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: cdf2bf25-7096-4348-b84c-fc91daacce44)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T10:40:39.273671Z f1b1407 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.92%. Comparing base (f855625) to head (a4dfc27).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
R/fmri_ttest_helpers.R 66.66% 2 Missing ⚠️
R/fmri_meta_methods.R 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #262      +/-   ##
==========================================
- Coverage   92.05%   91.92%   -0.13%     
==========================================
  Files          86       86              
  Lines       16230    16281      +51     
==========================================
+ Hits        14940    14967      +27     
- Misses       1290     1314      +24     
Files with missing lines Coverage Δ
R/doc_example_helpers.R 100.00% <100.00%> (ø)
R/fmri_meta.R 79.01% <100.00%> (-5.90%) ⬇️
R/fmri_meta_gds.R 90.34% <100.00%> (+0.05%) ⬆️
R/group_data.R 76.82% <100.00%> (+2.50%) ⬆️
R/group_data_csv.R 91.25% <100.00%> (+0.70%) ⬆️
R/group_data_gds.R 86.55% <100.00%> (-3.97%) ⬇️
R/group_data_h5.R 78.57% <100.00%> (+0.74%) ⬆️
R/group_data_nifti.R 91.09% <100.00%> (-0.62%) ⬇️
R/metafuns.R 94.93% <100.00%> (+0.14%) ⬆️
src/ols_t.cpp 77.64% <ø> (ø)
... and 2 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

tests/testthat/setup.R silences deprecations suite-wide, so nothing checked
the new warnings fire. The test turns them back on for the legacy accessors,
fmri_meta.group_data_nifti(), read_h5_full() and fmri_ttest() on legacy
data, and checks .legacy_group_quiet() keeps internal reads silent. Marked
for deletion with the stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFokJuZ18Chw2tkkMDvz4x
@cursor

cursor Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: a3a5f7c0-ff56-47f7-b598-eb2b7e3a99ed)

This branch has not been deployed

No deployments
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