diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2024-04-05 14:51:17 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2024-04-05 14:51:17 +0200 |
commit | 306c86a1821de2f54a15f44637eb481e9cc0c292 (patch) | |
tree | 43f9283a8d0137841f7140feddc7ca505e98ad85 /R | |
parent | e92727f871c2c8217251e34e52438f18c5f013bb (diff) |
Delay loading of the rdkit module
According to the recommendation found here:
https://rstudio.github.io/reticulate/articles/package.html#delay-loading-python-modules
Diffstat (limited to 'R')
-rw-r--r-- | R/zzz.R | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,6 +1,8 @@ .onLoad = function(libname, pkgname) { rdkit_available <- FALSE - rdkit_module <- try(reticulate::import("rdkit"), silent = TRUE) + rdkit_module <- try( + reticulate::import("rdkit", delay_load = TRUE), + silent = TRUE) if (!inherits(rdkit_module, "try-error")) { rdkit_available <- TRUE } |