Status: IMPLEMENTED (R-code migration + consolidation complete; only
_pkgdown.yml/ Title-Description cosmetic cleanup remains — see §10/§11). Scope: strip the legacyrave(RAVE 1.0) package down to the thin set of functions that the modern RAVE 2.0 ecosystem still relies on, delete the rest, and repair the helper closure so the package still builds and loads.
The original beauchamplab/rave package (RAVE 1.0) has been split into a set of
modern, mostly-CRAN packages:
| New package | Owner | Role |
|---|---|---|
dipsaus |
dipterix | low-level utilities |
filearray |
dipterix | on-disk arrays |
ieegio |
dipterix | neuro file IO |
ravetools |
dipterix | signal processing |
ravepipeline |
dipterix | options, pipelines, logging |
ravecore |
rave-ieeg | subjects, repositories, brain |
ravedash |
dipterix | shiny dashboard / app runtime |
threeBrain |
dipterix | 3D viewer |
ravemanager |
dipterix | installer / launcher |
rave (this package) is not on CRAN and is not a declared dependency of
any of the packages above. As a result, a plain text search for rave:: does
not reveal how the ecosystem still uses this package. The remaining couplings
are deliberately hidden (soft / optional), via:
asNamespace("rave")$<fun>()— call intoraveonly if it is installedpackage_installed("rave")/system.file(package = "rave")— feature gatesrave::start_rave(...)inside CLI launchers and help strings
Usage was determined by scanning the GitHub orgs rave-ieeg and dipterix for
hidden-coupling patterns (asNamespace("rave"), package_installed("rave"),
system.file(package = "rave"), R_user_dir("rave", ...), rave::,
loadNamespace/requireNamespace) rather than only rave::. Matches were then
filtered to package runtime code, discarding adhoc/, src/ comments,
scratch scripts, gists, and documentation.
| Consumer | Location | Symbol used | Notes |
|---|---|---|---|
ravecore |
R/workflow-archive-subject.R |
asNamespace("rave")$download_sample_data(subject, replace_if_exists=TRUE) |
Only when installing a RAVE 1.0 (version == 1) template subject. Guarded by package_installed("rave"). |
ravemanager |
inst/shell/launcher.R |
rave::start_rave(host, port, launch.browser, new, as_job=FALSE) |
RAVE CLI entry point. |
ravemanager |
R/profiles.R |
rave::start_rave(...) |
Only inside cli .run help strings (not executed by the package). |
ravemanager |
R/install.R, R/check.R |
treats "rave" as an installable / version-checked package |
rave stays a normal installable package; needs to build & load cleanly. |
User-mandated keepers: start_rave, start_rave2, start_yael.
These reference rave but are test-only or scratch, are skipped when rave
is absent, and do not constrain this migration:
rave-ieeg/rave-pipelinestests/testthat/*:rave::rave_prepare,rave::rave_preprocess_tools(RAVE 1.0-vs-2.0 comparison tests; skipped whenraveis not installed).dipterix/rave-gists/*.R,*/adhoc/*,*/src/*comments:rave::start_rave,rave_prepare,rave:::rave_brain2,Subject,ModuleEnvir,comp_parser,fake_session,afni_tools,wavelet,baseline,init_app, … — all in scratch/scripts/comments.
Decision: do not retain
rave_prepare/rave_preprocess_toolsfor the sake ofrave-pipelineslegacy comparison tests. Those tests already require a manual RAVE 1.0 install and are not part of CRAN CI. This is called out as a risk in §8.
ravedash, ravepipeline, ravetools, ieegio, filearray, threeBrain,
dipsaus contain no runtime reference to the rave namespace.
dipterix/rutabaga— fully decoupled.Imports: utils, stats, grDevices, graphics, methods, magrittr, stringr, digest, dipsaus. No reference toraveanywhere. No impact on this plan.beauchamplab/ravebuiltins(v0.1.1, RAVE 1.0 "Builtin Modules") — declares@import ravein itsNAMESPACE, and itsR/aaa.R/R/utils.Rcallrave::reload_module_package,rave::load_rave_module_package,rave::rave_context,rave::rave_options,rave::getDefaultDataRepository(all inside function bodies / lazy default args, resolved at call-time, not at load-time). Itsinst/tools/andinst/modules/are the RAVE 1.0 module runtime (usingget_module,customizedUI,define_input,progress,diagnose_signal,pwelch,rave_brain2,parse_components,mount_demo_subject,safe_write_csv,check_subjects2,lapply_async,init_app,close_tab,get_rave_theme, …).ravebuiltins/inst/toolsis NOT used byrave-ieeg/rave-pipelines(search returns empty;define_output_3d_viewerunused). The modern pipelines fully switched toravepipeline/ravedash.- The only
ravebuiltinsusage in modernrave-pipelinesis three pure exported palette helpers fromravebuiltins/R/common_plotting_functions.R—get_heatmap_palette,expand_heatmap,get_palette— none of which touchrave. - Consequence for this plan: no additional functions need to be retained.
The single requirement is that
raveremains a loadable / installable package so thatloadNamespace("ravebuiltins")(which doesimport(rave)) keeps succeeding. The keep-set in §4 already satisfies this. The RAVE 1.0 module machinery thatravebuiltins/inst/*would need is intentionally dropped (those legacy modules are superseded byrave-pipelines).
After migration the package exposes a thin surface. Dependency closures were verified to be light (no legacy machinery).
| Exported symbol | Source file (target) | Closure |
|---|---|---|
start_rave, start_rave2, start_yael |
R/start.R (renamed from shinyUI-main_app.R) |
ravedash::start_session only |
download_sample_data, download_subject_data |
R/download.R (extracted from io-subject.R) |
catgl, dir_create, rave_options, %?<-%, ravepipeline::load_yaml |
rave_options, save_options |
R/options.R (from core-options.R) |
ravepipeline::raveio_getopt/setopt (GUI branch removed) |
rave_version |
R/zzz.R |
utils::packageVersion |
arrange_data_dir |
R/options.R |
rave_options, catgl (light dir check used by .onAttach) |
Internal helpers retained: dir_create, get_val (R/utils.R),
stopifnot2, %within% (if still referenced), the roxygen @import block.
Optional small keepers (no heavy deps; keep only if desired): open_tab,
close_tab.
Classes & runtime:
class-ECoGRepository.R, class-Electrode.R, class-ExecEnvir.R,
class-ModuleEnvir.R, class-RaveFinalizer.R, class-RaveHistory.R,
class-RawSubject.R, class-Subject.R, core-data_repo.R,
legacy-cls_module.R, legacy-func_rave_prepare.R.
Modules / parsing / config:
core-modules.R, core-module_tools.R, module-conf.R, module-misc.R,
module-parse.R, module-viewdebug.R, rstudio-template.R.
Generics (S3 context system):
generics-core.R, generics-default.R, generics-define_initialization.R,
generics-define_input.R, generics-define_output.R,
generics-eval_when_ready.R, generics-input.R, generics-load_scripts.R,
generics-output.R, generics-shiny.R.
Signal processing (now ravetools):
signal-decimate.R, signal-misc.R, signal-notch.R, signal-plots.R,
signal-pwelch.R, signal-wavelet.R, core-baseline.R, export-plots.R.
Imaging / brain (now ravecore / threeBrain):
core-brain_model.R, core-localization.R.
Pre-processing (now ravecore):
core-preprocess.R, core-shinirize.R.
Shiny UI / modules (now ravedash / rave-pipelines):
shinyModule-preprocess-epoch.R, shinyModule-preprocess-notch.R,
shinyModule-preprocess-overview.R, shinyModule-preprocess-wavelet.R,
shinyUI-data_selector.R, shinyUI-debug_app.R, shinyUI-preprocess.R,
shinyUI-rave_options.R.
IO (now ieegio / ravecore):
io-afnisuma.R, io-csv.R, io-matlab.R, io-misc.R.
Checks & misc utils (now dipsaus / ravepipeline):
checks.R, checks2.R, import-pryr.R, utils-cache.R, utils-parallel.R,
utils-print.R, utils-progress.R, utils-rstudio.R, utils-shiny.R,
utils-shinydashboard.R.
| File | Keep | Delete |
|---|---|---|
shinyUI-main_app.R → R/start.R |
start_rave, start_rave2, start_yael (+ optional open_tab, close_tab) |
app_controller, app_ui, app_server, launch_demo, start_rave_legacy |
io-subject.R → R/download.R |
download_sample_data, download_subject_data |
load_meta, save_meta, archive_subject, all importers / subject IO |
core-options.R → R/options.R |
rave_options, save_options |
rave_options_gui usage, ugly_sample, rave_setup_workers |
core-file_structure.R → R/options.R |
arrange_data_dir |
arrange_modules, get_subjects, get_dir, test_hdspeed |
utils-misc.R → R/utils.R |
dir_create, get_val |
is.blank, is_invalid, zero_length, try_normalizePath, … (unless referenced by keep-set) |
aaa.R |
roxygen @import block, stopifnot2/%within% iff referenced |
rave_context*, rave_debug, get_conf/set_conf, toggle_debug, soft/hard_deprecated, subject_cache_dir, MNI305_to_MNI152, … |
zzz.R |
.onLoad, .onAttach, .onUnload, rave_version, latest_version, restart_r |
check_dependencies, check_dependencies2, finalize_installation, finalize_installation_internal_demo |
All S3method(...) for the deleted generics (define_input, define_output,
define_initialization, eval_when_ready, getDefaultReactive*,
get_rave_theme, init_module, load_scripts, mount_demo_subject,
rave_checks, reload_module_package, cache, …) and every export(...)
except the keep-set in §4 (plus download_subject_data). NAMESPACE is
regenerated, never hand-edited.
Deleting the files above leaves dangling references in the retained load hooks. Each must be repaired:
.onLoadcurrently callsrave_hist()(from deletedclass-RaveHistory.R) and the version-bump bookkeeping. → Strip to a minimal/no-op body (option management now belongs toravepipeline)..onUnloadcurrently callsclear_env(data_repository)(from deletedlegacy-cls_module.R). → Remove the body (no-op) or drop.onUnload.rave_options(launch_gui = TRUE)dispatches torave_options_gui(from deletedshinyUI-rave_options.R). → Remove the GUI branch; when called with no key it returns invisibly / emits a short message pointing toravemanager::version_info()..onAttachreferencesarrange_data_dir,latest_version,rave_version,rave_options— all retained and light. Guardlatest_version(usesraveio::load_json,raveiois Suggests) intryCatch.- Confirm
download_subject_datareferences only retained/imported helpers (catgl,dir_create,rave_options,%?<-%,ravepipeline::load_yaml) — verified, no fix needed. catgl(discovered during implementation). The old code calledcatglunqualified under@import dipsaus, but currentdipsausno longer exportscatgl(it now lives internal toravepipelineand exported byraveio).download_subject_data(the functionravecorecalls) usescatglthroughout, so a missingcatglwould break it at the first message. Fix: a small localcatglinR/utils.Rthat delegates to the exportedravepipeline::glue+ravepipeline::loggerand preserves the originalFATAL -> stopsemantics.%?<-%still resolves via@import dipsaus.
- DESCRIPTION — drop now-unused
Imports:signal,fftwtools,shinyFiles,shinyWidgets,DT,startup,digest,shinyjs,grid,devtools. Retain:ravecore,ravepipeline,ravedash,dipsaus,stringr,rlang,future,stats,utils. MovethreeBrain,raveiotoSuggests(used bystart_yael/latest_version). Re-auditSuggests. - NAMESPACE — regenerate with
devtools::document()after edits. - man/ — delete
.Rdfor removed exports (regenerated; never hand-edited). - tests/ — delete all of
tests/testthat/*(they exercise removed machinery:test.tensor.R,test.preprocess.R,test.subjectLoad.R,test.checks.R,test.moduledev.R,test.aaa.R) and replace with a minimal smoke test (package loads;start_rave,download_sample_dataexist). Keeptests/testthat.R,tests/spelling.R. - inst/ — remove RAVE 1.0 scaffolding no longer shipped:
default_module.R,module_addons/,template/,rstudio/,markdowns/,third_party/,utils/,hdf5_installer.sh,packages.txt,palettes.yaml,settings.yaml. KeepCITATION,WORDLIST, and any asset still referenced bystart_*. (Auditassets/,webr-rave/before removal.) - api/,
adhoc/,docker/,*.mdinstall guides — review/trim separately (out of scope for the R surface; flagged for a follow-up pass).
Risks
rave-pipelineslegacy comparison tests callrave::rave_prepare/rave::rave_preprocess_tools. Removing them disables those (already-skipped, non-CI) tests. Accepted; documented here.- Any private consumer using unexported internals (
rave:::…) will break. Only observed in scratch/adhoccode — accepted. download_subject_datawrites intorave_options('data_dir'); ensureravepipelineoption keys (data_dir,raw_data_dir) resolve at runtime.
Validation steps
devtools::document()— regenerate NAMESPACE + man/.devtools::load_all()— package loads with no missing-symbol errors.R CMD check(ordevtools::check()) — no errors from dangling refs.lintr::lint_package()— style (semicolons, no dot-prefixed names).- Smoke:
exists("start_rave"),exists("download_sample_data");asNamespace("rave")$download_sample_dataresolves;rave::start_ravesignature acceptshost, port, launch.browser, as_job, ....
- Write this plan (done).
- Create
R/start.R,R/download.R,R/options.R,R/utils.Rwith the extracted keep-set functions. - Trim
aaa.Randzzz.R; apply the §6 helper fixes. - Delete the §5.1 files and the leftover originals that were split.
- Delete
tests/testthat/*; add minimal smoke test. - Prune
inst/(§7) after auditing asset references. - Update
DESCRIPTION. devtools::document()→ regenerate NAMESPACE + man/ (prune stale.Rd).devtools::load_all()/devtools::check()/lintr::lint_package().
Done
R/reduced from 70 files to 6:start.R,download.R,options.R,utils.R,aaa.R,zzz.R(69 obsolete files deleted).- Keep-set in place:
start_rave,start_rave2,start_yael,open_tab,close_tab,download_sample_data,download_subject_data,rave_options,save_options,arrange_data_dir,rave_version,get_val(+ internaldir_create,is_invalid,catgl,latest_version). - Load hooks repaired:
.onLoad/.onUnloadremoved (they referenced the deletedrave_hist/data_repository/clear_env);.onAttachtrimmed of itsrave_histblock and the removed-GUI hint;rave_optionsGUI branch replaced (§6.3); localcatgladded (§6.6). tests/testthat/*(RAVE 1.0 machinery) removed;test-smoke.Radded.DESCRIPTIONtrimmed toImports: utils, dipsaus, ravedash, ravepipeline, shiny, stringr;Suggests: threeBrain, raveio, spelling, testthat.NAMESPACE+man/*.Rdregenerated via roxygen (stale.Rdpruned; 11 topics remain).- Verified:
roxygenise()OK,devtools::test()11/11 pass,codetools::checkUsagePackagereports no undefined globals,R CMD INSTALLsucceeds and the installed package loads.
Remaining (optional follow-ups, not yet done)
- Update
_pkgdown.ymlreference index (still lists removed topics; only affects pkgdown site generation, notR CMD check). - Optionally refresh the
Title/Description(still describe RAVE 1.0 HDF5/Matlab capabilities).
Follow-up requested after §10: hide as much surface as possible, drop the
dipsaus dependency, prune inst/, and collapse R/ to a single file.
rutabagaandravebuiltinswere re-audited (see §3.4).ravebuiltins'srave::rave_optionslives only in a dead RAVE 1.0 demo-path helper, not in the live palette functionsrave-pipelinesuses.- No live package references
rave'sinst/(nosystem.file(package = "rave");inst/webr-rave— a committed local experiment — is referenced nowhere).
Deleted all RAVE 1.0 scaffolding: assets/, default_module.R,
hdf5_installer.sh, markdowns/, module_addons/, packages.txt,
palettes.yaml, rstudio/, settings.yaml, template/, third_party/,
utils/, webr-rave/. Kept CITATION and WORDLIST.
- The only
dipsaususage left inR/was the%?<-%operator (plus the@import dipsaustag).%?<-%was copied verbatim fromdipsausR/language.Rinto the package as an internal operator (the author maintainsdipsaus; no license/authorship concern).catglwas already a local helper. - Every remaining external call is namespace-qualified (
ravedash::,ravepipeline::,shiny::,stringr::,utils::), so no@import/@importFromis needed.Imports:is nowutils, ravedash, ravepipeline, shiny, stringr. (dipsausis still loaded transitively viaravedash/ravepipeline, but is no longer a direct dependency.)
- Only
start_rave,start_rave2,start_yaelremain exported (therave::entry points used byravemanager,rave-pipelines,rpyANTs). - Everything else is now internal (no
@export). This is safe because:ravecorereachesdownload_sample_dataviaasNamespace("rave")$..., which resolves internal objects; and the other historicalrave::calls (rave_options,close_tab, …) exist only in dead RAVE 1.0 module code. - Internal functions use plain
#comments (not roxygen#'), so noman/*.Rdis generated for them.man/is now justrave-package.Rd,start_rave.Rd,start_yael.Rd.
All six files were merged into a single R/obsolete.R (the code
is expected to phase out over time). tests/testthat/test-smoke.R was updated to
assert the 3-export surface, the namespace-internal helpers, and the
asNamespace("rave")$download_sample_data access pattern.
roxygenise() → NAMESPACE has exactly three export() lines and no import();
devtools::test() 15/15 pass; codetools::checkUsagePackage reports only benign
style notes (no undefined globals); R CMD INSTALL succeeds; post-install
getNamespaceExports("rave") == the three launchers, dipsaus absent from
Imports, and asNamespace("rave")$download_sample_data resolves.