Learn R Programming

epiworldRcalibrate (version 0.1.4)

setup_python_deps: Set up Python dependencies for epiworldRcalibrate

Description

This function declares Python requirements through \'reticulate\' using \'py_require()\' (uv-backed in reticulate >= 1.41), then validates imports for all required modules (numpy, scikit-learn, joblib, PyTorch). Run this once after installing the package. This is kept separate from model functions so that package installation never happens automatically during normal use.

Usage

setup_python_deps(force = FALSE)

Value

Invisibly returns TRUE on success.

Arguments

force

Logical; if TRUE, resets package-managed Python requirements from a fresh R session. Default is FALSE.

Details

The function performs the following steps:

  1. Declares requirements with reticulate::py_require().

  2. Initializes Python through reticulate's managed environment.

  3. Verifies all packages can be imported.

Examples

Run this code
if (FALSE) {
# First-time setup (run once after installing the package)
setup_python_deps()

# Force reinstall if something went wrong
setup_python_deps(force = TRUE)
}

Run the code above in your browser using DataLab