Skip to content

Commit 0ac04d1

Browse files
committed
* update README with latest installation instructions
* add r-universe badge * fix cran badge * update greta_python_deps() and install_greta_deps() docs
1 parent 53dd4af commit 0ac04d1

File tree

3 files changed

+70
-14
lines changed

3 files changed

+70
-14
lines changed

R/install_greta_deps.R

+32-5
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,44 @@ restart_or_not <- function(restart){
201201

202202
#' Specify python dependencies for greta
203203
#'
204-
#' A helper function for specifying versions of Tensorflow (TF), Tensorflow Probability (TFP), and Python.
204+
#' A helper function for specifying versions of Tensorflow (TF), Tensorflow
205+
#' Probability (TFP), and Python. Defaulting to 2.15.0, 0.23.0, and 3.10.
206+
#' You can specify the version that you want to install, but it will check
207+
#' if these are compatible. That is, if you specify versions of TF/TFP/Python
208+
#' which do not work with each other, it will error and give a suggested
209+
#' version to install. It does this by using a dataset, `greta_deps_tf_tfp`,
210+
#' to check if the versions of TF, TFP, and Python specified are compatible
211+
#' on your operating system. You can inspect this dataset with
212+
#' `View(greta_deps_tf_tfp)`.
205213
#'
206-
#' @param tf_version Character. Tensorflow (TF) version in format major.minor.patch. Default is "2.15.0".
207-
#' @param tfp_version Character.Tensorflow probability (TFP) version major.minor.patch. Default is "0.23.0".
208-
#' @param python_version Character. Python version in format major.minor.patch. Default is "3.10".
214+
#' @param tf_version Character. Tensorflow (TF) version in format
215+
#' major.minor.patch. Default is "2.15.0".
216+
#' @param tfp_version Character.Tensorflow probability (TFP) version
217+
#' major.minor.patch. Default is "0.23.0".
218+
#' @param python_version Character. Python version in format major.minor.patch.
219+
#' Default is "3.10".
209220
#'
210-
#' @return list of dependencies
221+
#' @return data frame of valid dependencies
211222
#' @export
212223
#'
213224
#' @examples
214225
#' greta_python_deps()
226+
#' greta_python_deps(tf_version = "2.15.0")
227+
#' greta_python_deps(tf_version = "2.15.0", tfp_version = "0.23.0")
228+
#' greta_python_deps(tf_version = "2.15.0", python_version = "3.10")
229+
#' greta_python_deps(
230+
#' tf_version = "2.15.0",
231+
#' tfp_version = "0.23.0",
232+
#' python_version = "3.10"
233+
#' )
234+
#' # this will fail
235+
#' \dontrun{
236+
#' greta_python_deps(
237+
#' tf_version = "2.11.0",
238+
#' tfp_version = "0.23.0",
239+
#' python_version = "3.10"
240+
#' )
241+
#' }
215242
greta_python_deps <- function(tf_version = "2.15.0",
216243
tfp_version = "0.23.0",
217244
python_version = "3.10"){

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,21 @@ devtools::install_github("greta-dev/greta")
4040

4141
# Installing Python Dependencies
4242

43-
The `install_greta_deps()` function helps install the Python dependencies (Google's [TensorFlow](https://www.tensorflow.org/) version 1.14.0, and [tensorflow-probability](https://github.com/tensorflow/probability) version 0.7.0).
43+
The `install_greta_deps()` function helps install the Python dependencies (Google's [TensorFlow](https://www.tensorflow.org/) and [tensorflow-probability](https://github.com/tensorflow/probability)).
4444

45-
This helper function, `install_greta_deps()`, installs the exact pythons package versions needed. It also places these inside a "greta-env" conda environment. This isolates these exact python modules from other python installations, so that only `greta` will see them. This helps avoids installation issues, where previously you might update tensorflow on your computer and overwrite the current version needed by `greta`. Using this "greta-env" conda environment means installing other python packages should not be impact the Python packages needed by `greta`.
45+
By default, `install_greta_deps()` installs versions TF 2.15.0, and TFP version 0.23.0, using python 3.10. To change the versions of TF, TFP, or python that you want to use, you specify the `python_deps` argument of `install_greta_deps()`, which used `greta_python_deps()`. See `?install_greta_deps()` or `?greta_python_deps()` for more information.
46+
47+
This helper function, `install_greta_deps()`, installs the exact pythons package versions needed. It also places these inside a conda environment, "greta-env-tf2". This isolates these exact python modules from other python installations, so that only `greta` will see them. This helps avoids installation issues, where previously you might update tensorflow on your computer and overwrite the current version needed by `greta`. Using this "greta-env-tf2" conda environment means installing other python packages should not be impact the Python packages needed by `greta`.
4648

4749
If these python modules aren't yet installed, when `greta` is used, it provides instructions on how to install them for your system. If in doubt follow those.
4850

4951
<!-- badges: start -->
5052
[![Codecov test coverage](https://codecov.io/gh/greta-dev/greta/branch/master/graph/badge.svg)](https://app.codecov.io/gh/greta-dev/greta?branch=master)
5153
[![R-CMD-check](https://github.com/greta-dev/greta/workflows/R-CMD-check/badge.svg)](https://github.com/greta-dev/greta/actions)
52-
[![cran
53-
version](http://www.r-pkg.org/badges/version/greta)](https://CRAN.R-project.org/package=greta)
54+
[![cran version](http://www.r-pkg.org/badges/version/greta)](https://CRAN.R-project.org/package=greta)
5455
[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0)
5556
[![doi](https://zenodo.org/badge/73758247.svg)](https://zenodo.org/badge/latestdoi/73758247)
5657
[![joss](https://joss.theoj.org/papers/10.21105/joss.01601/status.svg)](https://joss.theoj.org/papers/10.21105/joss.01601)
5758
![](logos/bottom_banner.png)
59+
[![greta status badge](https://greta-dev.r-universe.dev/badges/greta)](https://greta-dev.r-universe.dev/greta)
5860
<!-- badges: end -->

man/greta_python_deps.Rd

+32-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)