Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more detail to greta_sitrep() #679

Merged
merged 12 commits into from
Jan 28, 2025

Conversation

njtierney
Copy link
Collaborator

Relevant issue #612

Goals:

  • R & Rstudio version
  • Greta version - and point to whether installed from CRAN/github etc.
  • Paths to Python, TF, and TFP. This might help debug issues with this
  • Paths to greta env (if used)
  • Note if greta env is used
  • Don't just print TF/TFP versions, list where they are installed
  • List python version, and where it is installed, which environment is used
  • Add various helper functions to identify where TF is installed
  • Add various helper functions to identify where TFP is installed

@njtierney njtierney added this to the 0.6.0 milestone Aug 20, 2024
@njtierney
Copy link
Collaborator Author

Currently can't seem to work out where TF and TFP are installed.

I'm also wondering if a verbose = TRUE option might be useful here? The info is getting a little bit long!

> greta_sitrep()

── R ─────────────────────────────────────
• version: 4.4.2path:
/Library/Frameworks/R.framework/Resources

── greta ─────────────────────────────────
• version: 0.4.5.9000path:
"/Users/nick/github/greta-dev/greta"

── python ────────────────────────────────
✔ python (v3.10) availablepath:
"/Users/nick/github/greta-dev/greta"path:
"/Users/nick/Library/r-miniconda-arm64"

── TensorFlow ────────────────────────────
✔ TensorFlow (v2.15.0) availableR path:
/Users/nick/Library/R/arm64/4.4/library/tensorflowpython path:
"/Users/nick/github/greta-dev/greta"

── TensorFlow Probability ────────────────
✔ TensorFlow Probability (v0.23.0) availa…
• R path:
/Users/nick/Library/R/arm64/4.4/library/tensorflowpython path:
"/Users/nick/github/greta-dev/greta"

── greta conda environment ───────────────
✔ greta conda environment availablepath:
/Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2/bin/python

── greta usability ───────────────────────
ℹ greta is ready to use!

Compared to:

> greta_sitrep()
✔ python (v3.10) available    
✔ TensorFlow (v2.15.0) availableTensorFlow Probability (v0.23.0) availa…
✔ greta conda environment availablegreta is ready to use!

So perhaps some option like:

greta_sitrep(verbosity = "verbose")

By default, and then some note that appears at the end of the messages that tells you about the verbose option?

Other options could be "quiet", "minimal", "verbose" ?

@njtierney
Copy link
Collaborator Author

Current behaviour

library(greta)
#> 
#> Attaching package: 'greta'
#> The following objects are masked from 'package:stats':
#> 
#>     binomial, cov2cor, poisson
#> The following objects are masked from 'package:base':
#> 
#>     %*%, apply, backsolve, beta, chol2inv, colMeans, colSums, diag,
#>     eigen, forwardsolve, gamma, identity, rowMeans, rowSums, sweep,
#>     tapply
greta_sitrep(verbosity = "minimal")
#> ℹ checking if python available
#> ✔ python (v3.10) available
#> 
#> ℹ checking if TensorFlow available
#> ✔ TensorFlow (v2.15.0) available
#> 
#> ℹ checking if TensorFlow Probability available
#> ✔ TensorFlow Probability (v0.23.0) available
#> 
#> ℹ checking if greta conda environment available
#> ✔ greta conda environment available
#> 
#> ℹ Initialising python and checking dependencies, this may take a moment.
#> ✔ Initialising python and checking dependencies ... done!
#> 
#> ℹ greta is ready to use!
greta_sitrep(verbosity = "detailed")
#> 
#> ── R ───────────────────────────────────────────────────────────────────────────
#> • version: 4.4.2
#> • path: /Library/Frameworks/R.framework/Resources
#> 
#> ── greta ───────────────────────────────────────────────────────────────────────
#> • version: 0.5.0.9000
#> • path: "/Users/nick/Library/R/arm64/4.4/library/greta"
#> 
#> ── python ──────────────────────────────────────────────────────────────────────
#> ℹ checking if python available
#> ✔ python (v3.10) available
#> 
#> • path: "/Users/nick/Library/R/arm64/4.4/library/greta"
#> • path: "/Users/nick/Library/r-miniconda-arm64"
#> 
#> ── TensorFlow ──────────────────────────────────────────────────────────────────
#> ℹ checking if TensorFlow available
#> ✔ TensorFlow (v2.15.0) available
#> 
#> • R path: '/Users/nick/Library/R/arm64/4.4/library/tensorflow'
#> • python path: "/Users/nick/Library/R/arm64/4.4/library/greta"
#> 
#> ── TensorFlow Probability ──────────────────────────────────────────────────────
#> ℹ checking if TensorFlow Probability available
#> ✔ TensorFlow Probability (v0.23.0) available
#> 
#> • R path: '/Users/nick/Library/R/arm64/4.4/library/tensorflow'
#> • python path: "/Users/nick/Library/R/arm64/4.4/library/greta"
#> 
#> ── greta conda environment ─────────────────────────────────────────────────────
#> ℹ checking if greta conda environment available
#> ✔ greta conda environment available
#> 
#> • path: /Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2/bin/python
#> ℹ greta is ready to use!
greta_sitrep(verbosity = "quiet")

Created on 2025-01-24 with reprex v2.1.1

Session info

sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.4.2 (2024-10-31)
#>  os       macOS Sequoia 15.1
#>  system   aarch64, darwin20
#>  ui       X11
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       Australia/Hobart
#>  date     2025-01-24
#>  pandoc   3.2.1 @ /opt/homebrew/bin/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version    date (UTC) lib source
#>  base64enc     0.1-3      2015-07-28 [1] CRAN (R 4.4.0)
#>  callr         3.7.6      2024-03-25 [1] CRAN (R 4.4.0)
#>  cli           3.6.3      2024-06-21 [1] CRAN (R 4.4.0)
#>  coda          0.19-4.1   2024-01-31 [1] CRAN (R 4.4.0)
#>  codetools     0.2-20     2024-03-31 [2] CRAN (R 4.4.2)
#>  crayon        1.5.3      2024-06-20 [1] CRAN (R 4.4.0)
#>  digest        0.6.37     2024-08-19 [1] CRAN (R 4.4.1)
#>  evaluate      1.0.1      2024-10-10 [1] CRAN (R 4.4.1)
#>  fastmap       1.2.0      2024-05-15 [1] CRAN (R 4.4.0)
#>  fs            1.6.5      2024-10-30 [1] CRAN (R 4.4.1)
#>  future        1.34.0     2024-07-29 [1] CRAN (R 4.4.0)
#>  globals       0.16.3     2024-03-08 [1] CRAN (R 4.4.0)
#>  glue          1.8.0      2024-09-30 [1] CRAN (R 4.4.1)
#>  greta       * 0.5.0.9000 2025-01-24 [1] local
#>  hms           1.1.3      2023-03-21 [1] CRAN (R 4.4.0)
#>  htmltools     0.5.8.1    2024-04-04 [1] CRAN (R 4.4.0)
#>  jsonlite      1.8.9      2024-09-20 [1] CRAN (R 4.4.1)
#>  knitr         1.49       2024-11-08 [1] CRAN (R 4.4.1)
#>  lattice       0.22-6     2024-03-20 [2] CRAN (R 4.4.2)
#>  lifecycle     1.0.4      2023-11-07 [1] CRAN (R 4.4.0)
#>  listenv       0.9.1      2024-01-29 [1] CRAN (R 4.4.0)
#>  magrittr      2.0.3      2022-03-30 [1] CRAN (R 4.4.0)
#>  Matrix        1.7-1      2024-10-18 [2] CRAN (R 4.4.2)
#>  parallelly    1.41.0     2024-12-18 [1] CRAN (R 4.4.1)
#>  pkgconfig     2.0.3      2019-09-22 [1] CRAN (R 4.4.0)
#>  png           0.1-8      2022-11-29 [1] CRAN (R 4.4.0)
#>  prettyunits   1.2.0      2023-09-24 [1] CRAN (R 4.4.0)
#>  processx      3.8.5      2025-01-08 [1] CRAN (R 4.4.1)
#>  progress      1.2.3      2023-12-06 [1] CRAN (R 4.4.0)
#>  ps            1.8.1      2024-10-28 [1] CRAN (R 4.4.1)
#>  R6            2.5.1      2021-08-19 [1] CRAN (R 4.4.0)
#>  Rcpp          1.0.13-1   2024-11-02 [1] CRAN (R 4.4.1)
#>  reprex        2.1.1      2024-07-06 [1] CRAN (R 4.4.0)
#>  reticulate    1.40.0     2024-11-15 [1] CRAN (R 4.4.1)
#>  rlang         1.1.4      2024-06-04 [1] CRAN (R 4.4.0)
#>  rmarkdown     2.29       2024-11-04 [1] CRAN (R 4.4.1)
#>  rstudioapi    0.17.1     2024-10-22 [1] CRAN (R 4.4.1)
#>  sessioninfo   1.2.2      2021-12-06 [1] CRAN (R 4.4.0)
#>  tensorflow    2.16.0     2024-04-15 [1] CRAN (R 4.4.0)
#>  tfruns        1.5.3      2024-04-19 [1] CRAN (R 4.4.0)
#>  vctrs         0.6.5      2023-12-01 [1] CRAN (R 4.4.0)
#>  whisker       0.4.1      2022-12-05 [1] CRAN (R 4.4.0)
#>  withr         3.0.2      2024-10-28 [1] CRAN (R 4.4.1)
#>  xfun          0.50.5     2025-01-15 [1] Github (yihui/xfun@116d689)
#>  yaml          2.3.10     2024-07-26 [1] CRAN (R 4.4.0)
#> 
#>  [1] /Users/nick/Library/R/arm64/4.4/library
#>  [2] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
#> 
#> ─ Python configuration ───────────────────────────────────────────────────────
#>  python:         /Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2/bin/python
#>  libpython:      /Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2/lib/libpython3.10.dylib
#>  pythonhome:     /Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2:/Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2
#>  version:        3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:51:49) [Clang 16.0.6 ]
#>  numpy:          /Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2/lib/python3.10/site-packages/numpy
#>  numpy_version:  1.26.4
#>  tensorflow:     /Users/nick/Library/r-miniconda-arm64/envs/greta-env-tf2/lib/python3.10/site-packages/tensorflow
#>  
#>  NOTE: Python version was forced by use_python() function
#> 
#> ──────────────────────────────────────────────────────────────────────────────

@njtierney njtierney merged commit 50ef770 into greta-dev:master Jan 28, 2025
3 checks passed
@njtierney njtierney deleted the add-more-info-sitrep-612 branch January 28, 2025 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant