diff --git a/NAMESPACE b/NAMESPACE index eeb4e5b0..1c8276ea 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -236,6 +236,7 @@ export(nelder_mead) export(newton_cg) export(normal) export(ones) +export(open_greta_install_log) export(opt) export(ordered_variable) export(pareto) @@ -244,7 +245,6 @@ export(powell) export(proximal_adagrad) export(proximal_gradient_descent) export(rdist) -export(read_greta_install_log) export(reinstall_greta_deps) export(reinstall_greta_env) export(reinstall_miniconda) diff --git a/NEWS.md b/NEWS.md index 9bbc51a8..190f28f2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -42,9 +42,9 @@ This release provides a few improvements to installation in greta. It should now * Added checking suite to ensure you are using valid versions of TF, TFP, and Python(#666) * Added data `greta_deps_tf_tfp` (#666), which contains valid versions combinations of TF, TFP, and Python. * remove `greta_nodes_install/conda_*()` options as #493 makes them defunct. -* Added option to write to a single logfile with `greta_set_install_logfile()`, and `write_greta_install_log()`, and `read_greta_install_log()` (#493) +* Added option to write to a single logfile with `greta_set_install_logfile()`, and `write_greta_install_log()`, and `open_greta_install_log()` (#493) * Added `destroy_greta_deps()` function to remove miniconda and python conda environment -* Improved `write_greta_install_log()` and `read_greta_install_log()` to use `tools::R_user_dir()` to always write to a file location. `read_greta_install_log()` will open one found from an environment variable or go to the default location. (#703) +* Improved `write_greta_install_log()` and `open_greta_install_log()` to use `tools::R_user_dir()` to always write to a file location. `open_greta_install_log()` will open one found from an environment variable or go to the default location. (#703) ## Minor diff --git a/R/install_greta_deps.R b/R/install_greta_deps.R index a0798224..61175f99 100644 --- a/R/install_greta_deps.R +++ b/R/install_greta_deps.R @@ -12,7 +12,7 @@ #' `tools::R_user_dir("greta")` as the directory to save a logfile named #' "greta-installation-logfile.html". To see installation notes or errors, #' after installation you can open the logfile with -#' [read_greta_install_log()], or you can navigate to the logfile and open +#' [open_greta_install_log()], or you can navigate to the logfile and open #' it in a browser. #' #' @param deps object created with [greta_deps_spec()] where you diff --git a/R/write-logfiles.R b/R/write-logfiles.R index fd20cc6b..dbcfa165 100644 --- a/R/write-logfiles.R +++ b/R/write-logfiles.R @@ -30,7 +30,7 @@ write_greta_install_log <- function(path = greta_logfile) { ) cli::cli_progress_step( - msg = "Open with: {.run read_greta_install_log()}" + msg = "Open with: {.run open_greta_install_log()}" ) template <- ' @@ -152,7 +152,7 @@ sys_get_env <- function(envvar){ #' #' @return opens a URL in your default browser #' @export -read_greta_install_log <- function(){ +open_greta_install_log <- function(){ greta_logfile <- sys_get_env("GRETA_INSTALLATION_LOG") diff --git a/README.md b/README.md index 3e9a722f..4c655fa0 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ devtools::install_github("greta-dev/greta") 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)). -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. +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 `deps` argument of `install_greta_deps()`, which used `greta_deps_spec()`. See `?install_greta_deps()` or `?greta_deps_spec()` for more information. 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`. @@ -51,7 +51,7 @@ If these python modules aren't yet installed, when `greta` is used, it provides [](https://app.codecov.io/gh/greta-dev/greta?branch=master) [](https://github.com/greta-dev/greta/actions) -[](https://CRAN.R-project.org/package=greta) +[](https://CRAN.R-project.org/package=greta) [](https://opensource.org/license/apache-2-0) [](https://zenodo.org/badge/latestdoi/73758247) [](https://joss.theoj.org/papers/10.21105/joss.01601) diff --git a/man/install_greta_deps.Rd b/man/install_greta_deps.Rd index 936ef724..d4ab5032 100644 --- a/man/install_greta_deps.Rd +++ b/man/install_greta_deps.Rd @@ -52,7 +52,7 @@ location with \code{GRETA_INSTALLATION_LOG} using \code{tools::R_user_dir("greta")} as the directory to save a logfile named "greta-installation-logfile.html". To see installation notes or errors, after installation you can open the logfile with -\code{\link[=read_greta_install_log]{read_greta_install_log()}}, or you can navigate to the logfile and open +\code{\link[=open_greta_install_log]{open_greta_install_log()}}, or you can navigate to the logfile and open it in a browser. By default, if using RStudio, it will now ask you if you want to restart diff --git a/man/read_greta_install_log.Rd b/man/open_greta_install_log.Rd similarity index 89% rename from man/read_greta_install_log.Rd rename to man/open_greta_install_log.Rd index d1db5f91..1c7a58e3 100644 --- a/man/read_greta_install_log.Rd +++ b/man/open_greta_install_log.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/write-logfiles.R -\name{read_greta_install_log} -\alias{read_greta_install_log} +\name{open_greta_install_log} +\alias{open_greta_install_log} \title{Read a greta logfile} \usage{ -read_greta_install_log() +open_greta_install_log() } \value{ opens a URL in your default browser diff --git a/vignettes/get_started.Rmd b/vignettes/get_started.Rmd index 38f7f643..c08b05df 100644 --- a/vignettes/get_started.Rmd +++ b/vignettes/get_started.Rmd @@ -50,52 +50,12 @@ library(greta) ### Helper functions to install TensorFlow -Before you can fit models with `greta`, you will also need to have a working installation of Google's [TensorFlow](https://www.tensorflow.org/) python package (version 1.14.0) and the [tensorflow-probability](https://github.com/tensorflow/probability) python package (version 0.7.0). In the future we will support different versions of Tensorflow and Tensorflow Probability, but currently we need these exact versions. +Before you can fit models with `greta`, you will also need to have a working installation of Google's [TensorFlow](https://www.tensorflow.org/) python package (version >= 2.0.0) and the [tensorflow-probability](https://github.com/tensorflow/probability) python package (version >= 0.8.0). -To assist with installing these Python packages, `greta` provides an installation helper, `install_greta_deps()`, which 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`. - -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. +If these python modules aren't yet installed when `greta` is used, it suggests to use `install_greta_deps()` to install the dependencies. We recommend using this function to install dependencies. For more detail on installation, see the vignette "installation". -#### Standard installation - -If the previous installation helper did not work, you can try the following: - -```{r install_tensorflow, eval = FALSE} -reticulate::install_miniconda() -reticulate::conda_create( - envname = "greta-env", - python_version = "3.7" - ) -reticulate::conda_install( - envname = "greta-env", - packages = c( - "numpy==1.16.4", - "tensorflow-probability==0.7.0", - "tensorflow==1.14.0" - ) - ) -``` - -Which will install the python modules into a conda environment named "greta-env". - -You can also not install these not into a special conda environment "greta-env", -like so: - -```{r install-deps-plain, eval = FALSE} -reticulate::install_miniconda() -reticulate::conda_install( - packages = c( - "numpy==1.16.4", - "tensorflow-probability==0.7.0", - "tensorflow==1.14.0" - ) - ) -``` - - -