From 306c86a1821de2f54a15f44637eb481e9cc0c292 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 5 Apr 2024 14:51:17 +0200 Subject: Delay loading of the rdkit module According to the recommendation found here: https://rstudio.github.io/reticulate/articles/package.html#delay-loading-python-modules --- R/zzz.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'R') diff --git a/R/zzz.R b/R/zzz.R index 5503a4a..248f830 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -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 } -- cgit v1.2.1