Skip to content

Commit fb0e971

Browse files
committed
check for suggests
1 parent 1d21b90 commit fb0e971

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

R/data.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@
2525
#' (sd <- sd_osn_load("merfish"))
2626
NULL
2727

28+
.require <- \(x) if (!requireNamespace(x, quietly=TRUE))
29+
stop(sprintf("Install '%s' to use this function.", x))
30+
2831
#' @rdname sd_data
2932
#' @export
3033
sd_osn_list <- \() {
31-
if (!requireNamespace("paws"))
32-
stop("Install 'paws' to use this function; without it,",
33-
" we can't check existence of data in OSN bucket.")
3434
# x = curl::curl("https://mghp.osn.xsede.org/bir190004-bucket01")
3535
# y = xml2::read_xml(x)
3636
# z = xml2::as_list(y)
37+
.require("paws")
3738
message("checking Bioconductor OSN bucket...")
3839
s3 <- paws::s3(
3940
credentials=list(anonymous=TRUE),
@@ -185,6 +186,8 @@ sd_make <- \(platform, srcdir, dest, env) {
185186
#' @rdname sd_data
186187
#' @export
187188
sdio_list <- \(env) {
189+
.require("basilisk")
190+
.require("reticulate")
188191
if (missing(env)) {
189192
proc <- basilisk::basiliskStart(.env, testload="spatialdata")
190193
on.exit(basilisk::basiliskStop(proc))

0 commit comments

Comments
 (0)