Skip to content

deprecate: expression_matrix_class across createGiottoObject + read helpers#372

Merged
jiajic merged 1 commit into
giotto-suite:devfrom
jiajic:feature/deprecate-expression-matrix-class
May 26, 2026
Merged

deprecate: expression_matrix_class across createGiottoObject + read helpers#372
jiajic merged 1 commit into
giotto-suite:devfrom
jiajic:feature/deprecate-expression-matrix-class

Conversation

@jiajic

@jiajic jiajic commented May 26, 2026

Copy link
Copy Markdown
Collaborator

`expression_matrix_class` was already deprecated in `createExprObj` but still had real defaults on `createGiottoObject`, `readExprData`, and `readExprMatrix`. `createGiottoObject` forwarded its default through `readExprData` → `.read_expression_data` → `createExprObj`, where `is_present()` matched and emitted the deprecation warning on every default `createGiottoObject` call. The test suite was generating ~3000 of these warnings per run as a result.

What changes

Same pattern as the existing `createExprObj` deprecation, applied to the rest of the chain:

  • `createGiottoObject` (R/create.R): default → `deprecated()`, `is_present()` warning, no longer forwards `expression_matrix_class` to `readExprData`.
  • `readExprData` (R/data_input.R): same.
  • `readExprMatrix` (R/data_input.R): same. The `DelayedArray` and `dbSparseMatrix` branches are removed — the function now always returns the default sparse class. Acceptable behavior change for a deprecated parameter; the warning surfaces it.
  • `.read_expression_data` (internal): drops the param entirely. No external callers; no longer plumbed through.
  • `.evaluate_expr_matrix` doc: stale `@param expression_matrix_class` block removed (the function signature never had this parameter).

Tests

Full suite: 967 / 0. Warning count dropped from ~4700 to 1449 with this cleanup.

🤖 Generated with Claude Code

…elpers

The expression_matrix_class param was already deprecated in createExprObj
but still had real defaults on createGiottoObject, readExprData, and
readExprMatrix. createGiottoObject forwarded the default into readExprData
→ .read_expression_data → createExprObj, which then matched is_present()
and emitted the deprecation warning on every default createGiottoObject
call — generating thousands of warnings across the test suite.

Three changes, same pattern as createExprObj:
- Default changed from a real character vector to lifecycle::deprecated()
- is_present() check emits the deprecation warning when the param is
  actually supplied by the caller
- Param is no longer forwarded to downstream helpers

.read_expression_data (internal) drops the param entirely — no external
callers, no longer plumbed through.

The DelayedArray / dbSparseMatrix branches in readExprMatrix are removed
since the param can no longer influence return type; the function now
always returns the default sparse class. Acceptable behavior change for
a deprecated parameter — surfaced via the warning.

Test suite: 967 / 0 (was previously generating ~3000 deprecation warnings
on every run from the cascade; warning count down to 1449).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jiajic jiajic merged commit 3d98c47 into giotto-suite:dev May 26, 2026
2 checks passed
Comment thread R/create.R
cores = determine_cores(),
raw_exprs = NULL,
expression_matrix_class = c("dgCMatrix", "DelayedArray"),
expression_matrix_class = deprecated(),
Comment thread R/create.R
images <- c(images, largeImages)
}

if (is_present(expression_matrix_class)) {
Comment thread R/data_input.R
"DelayedArray",
"dbSparseMatrix"
)) {
expression_matrix_class = deprecated()) {
Comment thread R/create.R

if (is_present(expression_matrix_class)) {
warning(sprintf(
"[createGiottoObject] param '%s' is deprecated",
Comment thread R/data_input.R
if (identical(expression_matrix_class, "dbSparseMatrix")) {
stop("File conversion to dbMatrix is not yet supported")
if (is_present(expression_matrix_class)) {
warning(sprintf(
jiajic added a commit to jiajic/GiottoClass that referenced this pull request May 26, 2026
Cascade giotto-suite#372 (expression_matrix_class deprecation) + giotto-suite#374 (flip
overlapPointDT[i] / [,j] default ids = TRUE → FALSE) into gmulti.
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