_r_env
R environment operations: libPaths, cmdstan path, package loading. Each function does exactly one R operation. Stateless.
Functions¶
log_warning(msg, method_name=None)
¶
Log a warning message.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
msg
|
str
|
The warning message to log |
required |
method_name
|
str
|
The name of the method/function. If None, will auto-detect from call stack. |
None
|
Source code in brmspy/helpers/log.py
get_lib_paths()
¶
get_cmdstan_path()
¶
Get current cmdstanr::cmdstan_path() or None.
Source code in brmspy/_runtime/_r_env.py
is_namespace_loaded(name)
¶
Check if package namespace is loaded.
Source code in brmspy/_runtime/_r_env.py
is_package_attached(name)
¶
Check if package is on search path.
Source code in brmspy/_runtime/_r_env.py
unload_package(name)
¶
Also known as footgun. Don't call without very good reason.
Attempt to unload package. Returns True if successful. Tries: detach -> unloadNamespace -> library.dynam.unload Does NOT uninstall.
Source code in brmspy/_runtime/_r_env.py
_find_libpath_packages(libpath, include_not_loaded=False)
¶
Source code in brmspy/_runtime/_r_env.py
_compute_unload_order(pkgs)
¶
Source code in brmspy/_runtime/_r_env.py
_unload_libpath_packages(libpath)
¶
Source code in brmspy/_runtime/_r_env.py
_is_runtime_path(p)
¶
_is_environment_path(p)
¶
_path_priority(p)
¶
set_lib_paths(paths)
¶
Set .libPaths() in R.
Source code in brmspy/_runtime/_r_env.py
set_cmdstan_path(path)
¶
Set cmdstanr::set_cmdstan_path().
Source code in brmspy/_runtime/_r_env.py
run_gc()
¶
forward_github_token()
¶
Copy GITHUB_TOKEN/GITHUB_PAT to R's Sys.setenv.