createLocalBasiliskEnv: Create a local conda environment manually

View source: R/createLocalBasiliskEnv.R

createLocalBasiliskEnvR Documentation

Create a local conda environment manually

Description

Manually create a local conda environment with versioning and thread safety. This is intended for use in analysis workflows rather than package development.

Usage

createLocalBasiliskEnv(dir, ...)

Arguments

dir

String containing the path to a directory in which the local environment is to be stored.

...

Further arguments to pass to setupBasiliskEnv.

Details

This function is intended for end users who wish to use the basilisk machinery for coordinating one or more Python environments in their analysis workflows. It can be inserted into, e.g., Rmarkdown reports to automatically provision and cache an environment on first compilation, which will be automatically re-used in later compilations. Some care is taken to ensure that the cached environment is refreshed when basilisk is updated, and that concurrent access to the environment is done safely.

Value

String containing a path to the newly created environment, or to an existing environment if one was previously created. This can be used in basiliskRun.

Author(s)

Aaron Lun

Examples

tmploc <- file.path(tempdir(), "my_package_C") # pip notation!
tmp <- createLocalBasiliskEnv(tmploc, packages="pandas==2.2.0")
basiliskRun(env=tmp, fun=function() { 
    X <- reticulate::import("pandas"); X$`__version__` 
}, testload="pandas")


LTLA/jormungandR documentation built on Feb. 6, 2024, 2:29 p.m.