Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
^vignettes/spatial_differential_expression\.Rmd$
^vignettes/spatial_enrichment_gradients_smi\.Rmd$
^vignettes/troubleshooting\.Rmd$
^vignettes/ondisk_stlists\.Rmd$
^vignettes/img/spatial_gradients\.png$
^vignettes/img/diagram_stenrich\.png$
^vignettes/img/smi_dir_structure\.png$
Expand Down
25 changes: 0 additions & 25 deletions .Rproj.user/49367F05/compilation-database/config.json

This file was deleted.

46 changes: 0 additions & 46 deletions .Rproj.user/49367F05/cpp-definition-cache

This file was deleted.

9 changes: 0 additions & 9 deletions .Rproj.user/49367F05/pcs/files-pane.pper

This file was deleted.

3 changes: 0 additions & 3 deletions .Rproj.user/49367F05/pcs/source-pane.pper

This file was deleted.

14 changes: 0 additions & 14 deletions .Rproj.user/49367F05/pcs/windowlayoutstate.pper

This file was deleted.

5 changes: 0 additions & 5 deletions .Rproj.user/49367F05/pcs/workbench-pane.pper

This file was deleted.

5 changes: 0 additions & 5 deletions .Rproj.user/49367F05/rmd-outputs

This file was deleted.

1 change: 0 additions & 1 deletion .Rproj.user/49367F05/saved_source_markers

This file was deleted.

6 changes: 0 additions & 6 deletions .Rproj.user/49367F05/sources/prop/1975183C

This file was deleted.

6 changes: 0 additions & 6 deletions .Rproj.user/49367F05/sources/prop/3657603E

This file was deleted.

6 changes: 0 additions & 6 deletions .Rproj.user/49367F05/sources/prop/4A59D713

This file was deleted.

6 changes: 0 additions & 6 deletions .Rproj.user/49367F05/sources/prop/4B68EA1E

This file was deleted.

6 changes: 0 additions & 6 deletions .Rproj.user/49367F05/sources/prop/6F08B49A

This file was deleted.

6 changes: 0 additions & 6 deletions .Rproj.user/49367F05/sources/prop/75F04464

This file was deleted.

6 changes: 0 additions & 6 deletions .Rproj.user/49367F05/sources/prop/8FEB9822

This file was deleted.

6 changes: 0 additions & 6 deletions .Rproj.user/49367F05/sources/prop/A1E52161

This file was deleted.

6 changes: 0 additions & 6 deletions .Rproj.user/49367F05/sources/prop/B9CDD1AC

This file was deleted.

6 changes: 0 additions & 6 deletions .Rproj.user/49367F05/sources/prop/DA253F8D

This file was deleted.

4 changes: 0 additions & 4 deletions .Rproj.user/49367F05/sources/prop/E92354B8

This file was deleted.

11 changes: 0 additions & 11 deletions .Rproj.user/49367F05/sources/prop/INDEX

This file was deleted.

This file was deleted.

Empty file.
11 changes: 0 additions & 11 deletions .Rproj.user/shared/notebooks/paths

This file was deleted.

27 changes: 23 additions & 4 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,29 @@ Rscript -e 'cat(curlGetHeaders("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/FridleyLab/spatialGE_Data/raw
and regenerates `tests/golden/` (via `dev/baseline/capture_baseline.R`) in
the same commit -- see the "Regression / baseline workflow" section of
`dev/ARCHITECTURE.md`.
- Do not run `devtools::document()`. Installed roxygen2 is newer than
`RoxygenNote` in `DESCRIPTION`; regenerating would churn all of `man/` and
`NAMESPACE` and bury the real diff. If an `.Rd` genuinely needs to change,
hand-edit it and say so in the commit message.
- `devtools::document()` is now safe to run, and is the way to change an `.Rd`.
It previously was not: several `.Rd` files had been hand-edited beyond their
roxygen sources, so regenerating *deleted* documented behavior -- the
`@details` and `@seealso` of `STlist_to_disk`, `STlist_to_memory`, `is_backed`,
`validate_store` and `as_Seurat`. Those paragraphs now live in the roxygen
blocks, so a regeneration round-trips. Do not hand-edit an `.Rd` any more:
that is what created the divergence.

Two things a `document()` run must not undo, both checked by CI:

- **`importFrom(methods, .hasSlot)`.** `R/stlist_readers.R` calls it on a
Seurat image slot. The call is conditional and `SeuratObject` is only in
Suggests, so roxygen can drop the import with no other symptom. It is
declared on `color_parse()` in `R/utils.R` for that reason.
- **`S3method(base::print, sge_manifest)`.** A bare `@export` on
`print.sge_manifest` makes roxygen2 >= 8 emit `export(print.sge_manifest)`
instead, which leaves `print()` on a manifest undispatched unless the
package happens to be attached. The tag is `@exportS3Method base::print`.

roxygen2 8 also replaced `RoxygenNote` with `Config/roxygen2/version` in
`DESCRIPTION`, and writes multi-symbol imports one per line. The second broke
the first version of the `.hasSlot` CI guard, which grepped for the
single-line form; it now asks `parseNamespaceFile()` instead.

## Failing gracefully (package-wide requirement)

Expand Down
111 changes: 111 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,114 @@ jobs:
options(spatialGE.psock = TRUE)
devtools::test(stop_on_failure = TRUE)
shell: Rscript {0}

# Three of the four vignettes are in .Rbuildignore, so R CMD check never
# builds them and devtools::test() never reads them: a chunk calling an
# exported function with an argument that no longer exists can sit there
# indefinitely. This parses every vignette's code and validates argument
# names against the formals, without evaluating anything.
- name: Vignette argument check
run: Rscript dev/ci/check_vignette_args.R

# roxygen2 8.x silently DROPS importFrom(methods,.hasSlot) when it
# regenerates NAMESPACE, even though .hasSlot is exported from methods and
# is used in R/stlist_readers.R (image handling). Regenerating docs with a
# newer roxygen therefore removes the import and breaks that path at
# runtime, with no error until a sample with images is read. Guard it.
- name: NAMESPACE import guard
# Asks R's own namespace parser instead of grepping. The previous version
# matched the literal line `importFrom(methods,.hasSlot)` that roxygen2 7
# wrote; roxygen2 8 writes multi-symbol imports one symbol per line, so
# the grep began failing on a NAMESPACE that was in fact correct.
run: |
Rscript -e 'nd <- parseNamespaceFile("spatialGE", "..", mustExist = TRUE);
ok <- any(vapply(nd$imports, function(i)
is.list(i) && identical(i[[1]], "methods") && ".hasSlot" %in% i[[2]],
logical(1)));
if (!ok) stop("NAMESPACE no longer imports methods::.hasSlot. R/stlist_readers.R calls it on a Seurat image slot; that call is conditional, so the import can be dropped with no other symptom.")'
shell: bash

## The `test` job above installs Imports only, which is deliberate: the committed
## tier must pass without any Suggests. The side effect is that anything gated by
## skip_if_not_installed() passes *by not running*. Today that is the whole of
## tests/testthat/test-seurat-interop.R -- i.e. as_Seurat() and Seurat v5 input,
## the headline features added in 2.0.0 -- so this job installs the Suggests and
## fails if those tests skip.
test-full-suggests:
runs-on: ubuntu-latest
name: full Suggests (interop must not skip)

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
r-version: '4.5.3'
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"all"'
extra-packages: any::devtools, any::testthat
cache: always

- name: Test with Suggests installed, asserting nothing skipped
run: |
res <- as.data.frame(devtools::test(reporter = "silent", stop_on_failure = FALSE))
interop <- res[grepl("seurat-interop", res$file), , drop = FALSE]
if (nrow(interop) == 0) {
stop("test-seurat-interop.R did not run at all.")
}
if (sum(interop$skipped) > 0) {
stop("test-seurat-interop.R skipped ", sum(interop$skipped),
" test(s). SeuratObject is a Suggests and must be installed here so that",
" as_Seurat()/Seurat v5 input is actually exercised.")
}
if (sum(res$failed) > 0 || sum(res$error) > 0) {
stop("Test failures: ", sum(res$failed), " failed, ", sum(res$error), " errored.")
}
cat("interop tests run:", nrow(interop),
"| suite expectations passed:", sum(res$passed), "\n")
shell: Rscript {0}

## devtools::test() never looks at NAMESPACE, roxygen/usage consistency, examples,
## or S4 registration -- so a broken @export, a stale .Rd, or an example that no
## longer runs all pass CI today. R CMD check covers those.
##
## error-on is "error" rather than "warning"/"note" on purpose: the repo has not
## been checked here before, so this job first establishes a baseline and fails on
## hard breakage (unloadable package, failing examples). Tighten it to "warning"
## once the existing NOTEs are cleared.
check:
runs-on: ubuntu-latest
name: R CMD check --as-cran

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: '4.5.3'
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
dependencies: '"all"'
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--as-cran", "--no-manual")'
error-on: '"error"'
upload-snapshots: true
Loading
Loading