Skip to content

Commit 6637bf0

Browse files
authored
Merge pull request #699 from njtierney/update-installation-notes
Update installation notes
2 parents 53dd4af + 53a39d2 commit 6637bf0

7 files changed

+105
-37
lines changed

R/install_greta_deps.R

+41-12
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
#' these are TF 2.15.0, TFP 0.23.0, and Python 3.10. These Python modules
55
#' will be installed into a conda environment named "greta-env-tf2".
66
#'
7-
#' To see install notes or errors, there isn't an argument to specify,
7+
#' To see installation notes or errors, there isn't an argument to specify,
88
#' instead you will need to specify and environment variable,
99
#' `GRETA_INSTALLATION_LOG`, with
1010
#' `Sys.setenv('GRETA_INSTALLATION_LOG'='path/to/logfile.html')`. Or use
1111
#' [greta_set_install_logfile()] to set the path, e.g.,
1212
#' `greta_set_install_logfile('path/to/logfile.html')`. You can also skip
13-
#' the restarting of R and use [write_greta_install_log()], which
14-
#' installation notes will indicate how to use if you haven't specified.
13+
#' the restarting of R and use [write_greta_install_log()]. If you have
14+
#' not specified the `GRETA_INSTALLATION_LOG` environmental variable, the
15+
#' installation notes will indicate how to use [write_greta_install_log()].
1516
#'
1617
#' @param python_deps object created with [greta_python_deps()] where you
1718
#' specify python, TF, and TFP versions. By default these are TF 2.15.0,
@@ -42,10 +43,11 @@
4243
#' package versions, and forcibly switch over to using that conda environment.
4344
#'
4445
#' If you don't want to use conda or the "greta-env-tf2" conda environment, you
45-
#' can install these specific versions of tensorflow (version 2.6.0), and
46-
#' tensorflow-probability (version 0.14.1), and ensure that the python
47-
#' environment that is initialised in this R session has these versions
48-
#' installed. This is now always straightforward, so we recommend installing
46+
#' can install versions that you like, e.g., using [reticulate::py_install()].
47+
#' If you want to see which versions of TF, TFP, and Python work with each
48+
#' other (at least according to information from tensorflows website), see the
49+
#' data `greta_deps_tf_tfp`, which is provided with greta. Managing your own
50+
#' installation is not always straightforward, so we recommend installing
4951
#' the python packages using `install_greta_deps()` for most users.
5052
#'
5153
#' @name install_greta_deps
@@ -201,17 +203,44 @@ restart_or_not <- function(restart){
201203

202204
#' Specify python dependencies for greta
203205
#'
204-
#' A helper function for specifying versions of Tensorflow (TF), Tensorflow Probability (TFP), and Python.
206+
#' A helper function for specifying versions of Tensorflow (TF), Tensorflow
207+
#' Probability (TFP), and Python. Defaulting to 2.15.0, 0.23.0, and 3.10.
208+
#' You can specify the version that you want to install, but it will check
209+
#' if these are compatible. That is, if you specify versions of TF/TFP/Python
210+
#' which do not work with each other, it will error and give a suggested
211+
#' version to install. It does this by using a dataset, `greta_deps_tf_tfp`,
212+
#' to check if the versions of TF, TFP, and Python specified are compatible
213+
#' on your operating system. You can inspect this dataset with
214+
#' `View(greta_deps_tf_tfp)`.
205215
#'
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".
216+
#' @param tf_version Character. Tensorflow (TF) version in format
217+
#' major.minor.patch. Default is "2.15.0".
218+
#' @param tfp_version Character.Tensorflow probability (TFP) version
219+
#' major.minor.patch. Default is "0.23.0".
220+
#' @param python_version Character. Python version in format major.minor.patch.
221+
#' Default is "3.10".
209222
#'
210-
#' @return list of dependencies
223+
#' @return data frame of valid dependencies
211224
#' @export
212225
#'
213226
#' @examples
214227
#' greta_python_deps()
228+
#' greta_python_deps(tf_version = "2.15.0")
229+
#' greta_python_deps(tf_version = "2.15.0", tfp_version = "0.23.0")
230+
#' greta_python_deps(tf_version = "2.15.0", python_version = "3.10")
231+
#' greta_python_deps(
232+
#' tf_version = "2.15.0",
233+
#' tfp_version = "0.23.0",
234+
#' python_version = "3.10"
235+
#' )
236+
#' # this will fail
237+
#' \dontrun{
238+
#' greta_python_deps(
239+
#' tf_version = "2.11.0",
240+
#' tfp_version = "0.23.0",
241+
#' python_version = "3.10"
242+
#' )
243+
#' }
215244
greta_python_deps <- function(tf_version = "2.15.0",
216245
tfp_version = "0.23.0",
217246
python_version = "3.10"){

R/reinstallers.R

+7-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
#' This can be useful when debugging greta installation to get to "clean slate".
44
#' There are four functions:
55
#'
6-
#' - `remove_greta_env()` removes the 'greta-env-tf2' conda environment
7-
#' - `remove_miniconda()` removes miniconda installation
8-
#' - `reinstall_greta_env()` remove 'greta-env-tf2' and reinstall it using `greta_create_conda_env()` (which is used internally).
9-
#' - `reinstall_miniconda()` removes miniconda and reinstalls it using `greta_install_miniconda()` (which is used internally)
6+
#' - [remove_greta_env()] removes the 'greta-env-tf2' conda environment
7+
#' - [remove_miniconda()] removes miniconda installation
8+
#' - [reinstall_greta_env()] remove 'greta-env-tf2' and reinstall it
9+
#' using [greta_create_conda_env()] (which is used internally).
10+
#' - [reinstall_miniconda()] removes miniconda and reinstalls it using
11+
#' [greta_install_miniconda()] (which is used internally)
1012
#'
1113
#' @return invisible
1214
#' @export
1315
#' @name reinstallers
16+
#' @seealso [destroy_greta_deps()]
1417
#'
1518
#' @examples
1619
#' \dontrun{

R/write-logfiles.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Set logfile path when installing greta
22
#'
33
#' To help debug greta installation, you can save all installation output
4-
#' to a single logfile.
4+
#' to a single logfile.
55
#'
66
#' @param path valid path to logfile - should end with `.html` so you
77
#' can benefit from the html rendering.

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.

man/install_greta_deps.Rd

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

man/reinstallers.Rd

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

0 commit comments

Comments
 (0)