Skip to content

Say that merge(collapse = TRUE) is not implemented - #309

Closed
BenjaminDEMAILLE wants to merge 1 commit into
satijalab:mainfrom
BenjaminDEMAILLE:docs/merge-collapse-unimplemented
Closed

BenjaminDEMAILLE wants to merge 1 commit into
satijalab:mainfrom
BenjaminDEMAILLE:docs/merge-collapse-unimplemented

Conversation

@BenjaminDEMAILLE

Copy link
Copy Markdown

Fixes #175.

The problem

The documentation describes collapse as a working option:

collapse: If TRUE, merge layers of the same name together; if FALSE, appends labels to the layer name

Passing it does this:

merge(a, b, collapse = TRUE)
#> Error: Collapsing layers is not yet supported

A reader has no way to know the option is unavailable short of trying it, which is how the report arrives at it.

The change

Document the actual state, in the roxygen block and the three generated Rd files that carry it:

collapse: Not yet implemented: TRUE raises an error. When implemented, will merge layers of the same name together; FALSE, the default, appends labels to the layer name

man/merge.Assay.Rd already records labels, collapse as "Currently unused" for the v3 method, so it is left alone.

No behaviour change. This describes the code as it is rather than implementing the feature, which is a larger piece of work and a separate decision. Happy to close this in favour of implementing collapse if that is on the roadmap.

Tests

New tests/testthat/test_merge_collapse.R pins the documented contract so the docs and the code cannot drift apart again unnoticed: collapse = TRUE raises, collapse = FALSE keeps the layers separate and merges the cells, and the default matches collapse = FALSE.

Suite 180 passing, R CMD check Status OK.

🤖 Generated with Claude Code

The documentation describes the argument as working:

  collapse: If TRUE, merge layers of the same name together; if FALSE,
            appends labels to the layer name

Passing it does this instead:

  merge(a, b, collapse = TRUE)
  #> Error: Collapsing layers is not yet supported

So a reader has no way to know the option is unavailable short of trying
it, which is how the report arrives at it.

Document the actual state in the roxygen block and the three generated Rd
files that carry it. merge.Assay.Rd already records `labels, collapse` as
"Currently unused" for the v3 method and is left alone.

No behaviour change: this describes the code as it is rather than
implementing the feature, which is a larger piece of work and a separate
decision. The added test pins the documented contract so the two cannot
drift apart again unnoticed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@BenjaminDEMAILLE

Copy link
Copy Markdown
Author

Superseded by #319, which groups the message-only PRs into one, since they share a rationale and none of them changes behaviour. The commit is carried over unchanged; closing here to keep the queue down rather than because anything was wrong with it.

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.

SeuratObject::merge - collapse option mentioned in documentation but not yet implemented

1 participant