load_environment: Load Python Environment and Source Model Modules

View source: R/environment.r

load_environmentR Documentation

Load Python Environment and Source Model Modules

Description

This function activates a specified Python virtual environment and sources Python modules used by the vmsae package, including models and python scripts.

Usage

load_environment(envname = "vmsae", is_conda = FALSE)

Arguments

envname

Character. The name of the Python environment to create or update. Default is "vmsae".

is_conda

Boolean. The indicator for whether the loaded environment is a conda environment. Default is "FALSE".

Details

The function loads four Python scripts located in the package's ⁠py/⁠ directory:

  • vgmcar.py

  • vae.py

  • train_vae.py

  • car_dataset.py

The environment must be created beforehand (e.g., using install_environment()), and must include all Python dependencies required by these modules.

Value

No return value, called for side effects

Examples

## Not run: 
library(vmsae)

# this function is time consuming for the first run
install_environment()
load_environment()          # Load default "vmsae" environment

# this function is time consuming for the first run
install_environment("custom")
load_environment("custom") # Load custom virtual environment

load_environment("custom", is_conda = TRUE) # Load custom conda environment

## End(Not run)


vmsae documentation built on June 21, 2025, 9:07 a.m.