R/conda_greta_env.R

Defines functions have_greta_conda_env using_greta_conda_env use_greta_conda_env

use_greta_conda_env <- function() {
  tryCatch(
    expr = reticulate::use_condaenv("greta-env", required = TRUE),
    error = function(e) NULL
  )
}

using_greta_conda_env <- function() {
  config <- reticulate::py_discover_config()
  grepl("greta-env", config$python)
}

have_greta_conda_env <- function(){
  tryCatch(
    expr = "greta-env" %in% reticulate::conda_list()$name,
    error = function(e) FALSE
  )
}

Try the greta package in your browser

Any scripts or data that you put into this service are public.

greta documentation built on Sept. 8, 2022, 5:10 p.m.