S3 reading support#198
Conversation
| #' @export | ||
| readPoint <- function(x, ...) { | ||
| pq <- list.files(x, "\\.parquet$", full.names=TRUE) | ||
| pq <- paste0(x, file.path("points.parquet", "part.0.parquet")) |
There was a problem hiding this comment.
TODO: open an issue in Spatialdata python. Why do points have an extra nesting level?
- shapes are
shapes/layer_name/shapes.parquet - points are
points/layer_name/points.parquet/part.0.parquet
Is this really intended? If so, if this desirable?
| skip <- vapply(args, isFALSE, logical(1)) | ||
|
|
||
| x <- Rarr:::.normalize_array_path(x) | ||
| store_meta <- Rarr:::.read_consolidated_metadata(x)$metadata |
There was a problem hiding this comment.
In Bioconductor, it seems acceptable to use internal functions (see, e.g., ZarrArray) but ideally, this will be eventually exported: Huber-group-EMBL/Rarr#116
| .readLayer <- \(l) { | ||
| j <- list.dirs(file.path(x, l), recursive=FALSE, full.names=TRUE) | ||
| names(j) <- basename(j) | ||
| message(" reading ", l, "...") |
There was a problem hiding this comment.
I put this for now because S3 reading is quite slow and I wanted to see what was happening but I don't usually love super verbose functions.
| # Until we have a complete store interface (https://github.com/Huber-group-EMBL/Rarr/pull/176), | ||
| # only local objects can be fully validated. |
There was a problem hiding this comment.
This will be handled by rome eventually anyways.
| skip <- vapply(args, isFALSE, logical(1)) | ||
|
|
||
| x <- Rarr:::.normalize_array_path(x) | ||
| store_meta <- Rarr:::.read_consolidated_metadata(x)$metadata |
There was a problem hiding this comment.
TODO: Spatialdata python uses zmetadata instead of .zmetadata. Is there a special reason for this? AFAIK, zarr python uses the hidden version by default.
for better performance
No description provided.