Conversation
There was a problem hiding this comment.
Pull request overview
Updates SpatialData’s query() utilities and their tests/docs, focusing on bounding-box subsetting across element types.
Changes:
- Simplifies
query()forImageArray/LabelArrayto direct array slicing and clampsxmax/ymaxto object dimensions. - Reworks
query()forShapeFrameto usesf::st_crop()and updates tests accordingly. - Updates documentation/examples and adds
sf::st_cropto imports.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
R/query.R |
Refactors query() methods (notably Image/Label/Shape) and adds bbox validation. |
tests/testthat/test-query.R |
Updates expectations for new query behavior (esp. ShapeFrame, ImageArray transform assertions). |
man/query.Rd |
Syncs generated docs/examples with updated method signatures. |
NAMESPACE |
Adds sf::st_crop import to support ShapeFrame cropping. |
Comments suppressed due to low confidence (1)
man/query.Rd:27
- The Rd still documents
jas a general argument (“index or name of coordinate space”), butquery,ImageArray/LabelArray/ShapeFrameno longer acceptjwhilequery,PointFramestill requires it. Please update the argument documentation to reflect which methods accept/ignorej(or restore consistent method signatures) to avoid confusing users.
\S4method{query}{ImageArray}(x, ...)
\S4method{query}{LabelArray}(x, ...)
\S4method{query}{ShapeFrame}(x, ...)
\S4method{query}{PointFrame}(x, j, ...)
}
\arguments{
\item{x}{\code{SpatialData} element.}
\item{j}{scalar character or integer; index or name of coordinate space.}
\item{...}{optional arguments passed to and from other methods.}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
man/query.Rd:27
- The Rd still documents argument
jin the shared \arguments section, but theImageArrayandPointFramemethod signatures in \usage no longer includej. This makes?querymisleading for those methods. Consider documentingjasSpatialData-only (or restoringjconsistently across methods).
\arguments{
\item{x}{\code{SpatialData} element.}
\item{j}{scalar character or integer; index or name of coordinate space.}
\item{...}{optional arguments passed to and from other methods.}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
Comments suppressed due to low confidence (1)
man/query.Rd:28
- The documentation still lists
jas an argument forquery()globally, but the ImageArray/PointFrame methods no longer acceptj(per the updated \usage). This can confuse users about which methods support coordinate-space selection. Consider clarifying in the Rd (and/or roxygen) thatjonly applies to the SpatialData method (or reintroducingjconsistently).
\arguments{
\item{x}{\code{SpatialData} element.}
\item{j}{scalar character or integer; index or name of coordinate space.}
\item{...}{optional arguments passed to and from other methods.}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… image/label query
No description provided.