R/is_installed_gatai.R

Defines functions is_installed_gatai

Documented in is_installed_gatai

#' @title Test whether GATAI is installed on user machine
#' @description Helper function to test if the user has set up GATAI correctly in their environment.
#' @export
is_installed_gatai <- function() {
  tryCatch({
    gatai <- reticulate::import("gatai", convert = FALSE)
    message("GATAI is installed.")
    return(TRUE)
  }, error = function(e) {
    message("Please check your conda environment and python installation for more details.\n", "Please also consult 'reticulate::install_python()' to install the correct python version to begin with.")
    print(reticulate::py_config())
    stop(simpleError("GATAI is not installed.")) 
  })
}
drostlab/myTAI documentation built on Feb. 15, 2025, 6:44 p.m.