greta-dev / greta

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

Use options object to manage python version installation options #664

Closed njtierney closed 1 month ago

njtierney commented 1 month ago

So the user will specify something like:

greta_python_deps <- function(tf_version = "2.15.0",
                              tfp_version = "0.23.0",
                              keras_version = "2.15.0",
                              versions = c("exact", "gte"),
                              py_version = "3.9"){
  structure(
    list(
      tf_version = tf_version,
      tfp_version = tfp_version,
      keras_version = keras_version,
      versions = versions
    ),
    class = "greta_python_deps"
  )
}

We could even potentially identify known cases where the sets of these installations will not work. E.g., we might know that python version 3.7 is no longer supported. Or that certain versions of TF/TFP aren't compatible. These could error by default, and we could allow override by specifying an environment variable.

https://design.tidyverse.org/argument-clutter.html

njtierney commented 1 month ago

Instead of a versions arg, which would work with an internal switch pattern, I think it's better to assume exact versions.

While we could add functionality for >= I think it might end up meaning we gain less control over what is installed.

njtierney commented 1 month ago

As part of this option we can check for bad combinations of Python version + TF + TFP.

https://www.tensorflow.org/install/source#tested_build_configurations

njtierney commented 1 month ago

I think this checking for bad combinations should be its own issue in #638