tests/testthat/setup.R

# Force single-threaded execution during tests to avoid CRAN NOTE
# ("CPU time N times elapsed time")
if (requireNamespace("future", quietly = TRUE)) {
  future::plan(future::sequential)
}

# Limit BLAS/OpenMP threads used by NumPy/scipy via reticulate
Sys.setenv(
  OMP_NUM_THREADS = 1,
  OPENBLAS_NUM_THREADS = 1,
  MKL_NUM_THREADS = 1,
  VECLIB_MAXIMUM_THREADS = 1,
  NUMEXPR_NUM_THREADS = 1
)

skip_if_no_pymyami <- function() {
  have_pymyami <- reticulate::py_module_available("pymyami")
  if (!have_pymyami) {
    testthat::skip("pymyami not available for testing")
  }
}

Try the kgen package in your browser

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

kgen documentation built on March 28, 2026, 9:08 a.m.