py_estimate_rest: Run 'estimate_rest' with Python in a Separate Process

View source: R/estimate_rest.R

py_estimate_restR Documentation

Run estimate_rest with Python in a Separate Process

Description

Run estimate_rest with Python in a Separate Process

Usage

py_estimate_rest(
  ...,
  pyenv_function = function() {
     rester::py_require_rester()
 },
  show = FALSE
)

Arguments

...

arguments to pass to estimate_rest()

pyenv_function

function that sets up Python in the child process. By default, it uses py_require_rester(). If this function has an args argument, the output of pyenv_function will be re-assigned to args.

show

Logical, whether to show the standard output on the screen while the child process is running, passed to callr::r()

Value

Output from estimate_rest().

Examples


  # Runs only after ar_setup(), so Python is not set up otherwise
  if (requireNamespace("callr", quietly = TRUE) &&
      ar_have_repo() && ar_have_weights("linear_sleepstages")) {
    data = ar_example_data(n_hours = 2.5)
    out = py_estimate_rest(data, model = "linear_sleepstages",
                           context_window_shift = 32L)
  }


rester documentation built on Nov. 13, 2026, 1:06 a.m.