Skip to content

feat: spatRelate generic + giottoSpatial method#376

Merged
jiajic merged 4 commits into
giotto-suite:devfrom
jiajic:dev
May 30, 2026
Merged

feat: spatRelate generic + giottoSpatial method#376
jiajic merged 4 commits into
giotto-suite:devfrom
jiajic:dev

Conversation

@jiajic

@jiajic jiajic commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds spatRelate() — the filter-form complement to terra::relate(). Returns x narrowed to features satisfying a spatial predicate against any feature of y, rather than a relation matrix.
  • Method on (giottoSpatial, giottoSpatial) evaluates eagerly via relate() + subset.
  • Generic exists primarily so on-disk backends (GiottoDisk's parquetGeomBase) can queue the predicate as a lazy op and avoid materializing a full relation matrix.
  • Includes a TODO marker to audit existing internal relate() call sites for swap candidates.

Test plan

  • tests/testthat/test-spatRelate.R — class preservation, narrowing correctness vs relate(pairs = TRUE), default relation, predicate effects, empty result, error on invalid relation
  • CI green on R CMD check + BiocCheck

🤖 Generated with Claude Code

jiajic and others added 4 commits May 29, 2026 13:22
New S4 generic for the "filter form" complement to relate() — returns x
narrowed by a spatial predicate rather than a relation matrix. The eager
method on (giottoSpatial, giottoSpatial) wraps relate() + subset; the on-
disk lazy form lives in GiottoDisk via methods on parquetGeomBase.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Five tests covering the eager filter-form contract: returns same class
as x, narrowed to features satisfying the predicate; default relation
is intersects; predicate choice affects narrowing; empty result is a
zero-row giottoSpatial.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jiajic jiajic merged commit cf780b6 into giotto-suite:dev May 30, 2026
3 checks passed
jiajic added a commit to jiajic/GiottoClass that referenced this pull request Jun 1, 2026
Cascades the spatRelate generic + giottoSpatial method (PR giotto-suite#376) and
related cleanup commits from dev into gmulti. Clean 3-way merge — no
conflicts.
jiajic added a commit that referenced this pull request Jun 1, 2026
Reconciles origin's local dev cascade (PR #376 spatRelate work merged
in) with upstream/gmulti's prior PR #375 merge commit. Clean 3-way
merge — no conflicts.
jiajic added a commit that referenced this pull request Jun 1, 2026
overlapPointDT-class.Rd reflects PR #374 (ids = TRUE → FALSE default,
updated examples). spatRelate.Rd reflects PR #376 (trimmed
cross-package GiottoDisk context). Source roxygen was updated in those
PRs but the generated .Rd files were not refreshed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jiajic added a commit that referenced this pull request Jun 1, 2026
Brings in doc regen for overlapPointDT (PR #374 ids flip) and spatRelate
(PR #376 cross-package trim) from upstream/dev #377.
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.

1 participant