greta-dev / greta

simple and scalable statistical modelling in R
https://greta-stats.org
Other
528 stars 63 forks source link

Use a `python_deps` argument in `install_greta_deps()` and create known sets of working installers #666

Closed njtierney closed 2 months ago

njtierney commented 2 months ago

Related to #664 and #638

So instead of

install_greta_deps <- function(method = c("auto", "virtualenv", "conda"),
                               conda = "auto",
                               timeout = 5,
                               scheme = c("default", "tf213", "manual", "aws"),
                               manual = FALSE,
                               restart = c("ask", "force", "no"),
                               ...) {
...
}

It will be something like:

install_greta_deps <- function(py_deps = greta_python_deps(),
                               restart = c("ask", "force", "no"),
                               timeout = 5,
                               ...) {
...
}

Then you can create your own specs that work, or use some existing ones, e.g.,

aws_install <- greta_python_deps(
  tf_version = "2.11.0",
  tfp_version = "0.19.0",
  keras_version = NULL,
  py_version = "3.8.15"
)

install_greta_deps(py_deps = aws_install)

And also we could create a set of known install sets that work and provide them as objects within greta, e.g.,

# macOS
install_greta_deps(py_deps = .greta_deps_macos)
# windows
install_greta_deps(py_deps = .greta_deps_windows)
# linux
install_greta_deps(py_deps = .greta_deps_windows)
# linux
install_greta_deps(py_deps = .greta_deps_aws)