aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2024-04-07 15:01:35 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2024-04-07 15:01:35 +0200
commit1025fdbb55b0452c98ed55e7fa6399e2c99d72c0 (patch)
treedb362f1e40e597e55ec3b529b923a746b0be1e62
parent306c86a1821de2f54a15f44637eb481e9cc0c292 (diff)
Improve reticulate startup code
-rw-r--r--R/chent.R1
-rw-r--r--R/zzz.R8
2 files changed, 3 insertions, 6 deletions
diff --git a/R/chent.R b/R/chent.R
index 6d18277..4375305 100644
--- a/R/chent.R
+++ b/R/chent.R
@@ -24,7 +24,6 @@
#' if (!is.null(caffeine$Picture)) {
#' plot(caffeine)
#' }
-
chent <- R6Class("chent",
public = list(
#' @field identifier (`character(1)`)\cr
diff --git a/R/zzz.R b/R/zzz.R
index 248f830..f18e559 100644
--- a/R/zzz.R
+++ b/R/zzz.R
@@ -1,11 +1,9 @@
.onLoad = function(libname, pkgname) {
- rdkit_available <- FALSE
+ conf <- reticulate::py_discover_config("rdkit")
+ rdkit_available <- conf$available
rdkit_module <- try(
- reticulate::import("rdkit", delay_load = TRUE),
+ reticulate::import("rdkit"),
silent = TRUE)
- if (!inherits(rdkit_module, "try-error")) {
- rdkit_available <- TRUE
- }
assign('rdkit_available', rdkit_available, envir = topenv())
assign('rdkit_module', rdkit_module, envir = topenv())
}

Contact - Imprint