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

future's multiprocess is deprecated #394

Closed
Tracked by #546
njtierney opened this issue Apr 28, 2021 · 4 comments
Closed
Tracked by #546

future's multiprocess is deprecated #394

njtierney opened this issue Apr 28, 2021 · 4 comments
Assignees
Labels
Milestone

Comments

@njtierney
Copy link
Collaborator

library(future)
plan(multiprocess)
#> Warning: Strategy 'multiprocess' is deprecated in future (>= 1.20.0). Instead,
#> explicitly specify either 'multisession' or 'multicore'. In the current R
#> session, 'multiprocess' equals 'multisession'.

Created on 2021-04-28 by the reprex package (v2.0.0)

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.0.5 (2021-03-31)
#>  os       macOS Big Sur 10.16         
#>  system   x86_64, darwin17.0          
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_AU.UTF-8                 
#>  ctype    en_AU.UTF-8                 
#>  tz       Australia/Perth             
#>  date     2021-04-28                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date       lib source            
#>  backports     1.2.1   2020-12-09 [1] standard (@1.2.1) 
#>  cli           2.4.0   2021-04-05 [1] CRAN (R 4.0.2)    
#>  codetools     0.2-18  2020-11-04 [1] CRAN (R 4.0.5)    
#>  crayon        1.4.1   2021-02-08 [1] CRAN (R 4.0.2)    
#>  digest        0.6.27  2020-10-24 [1] standard (@0.6.27)
#>  ellipsis      0.3.1   2020-05-15 [1] standard (@0.3.1) 
#>  evaluate      0.14    2019-05-28 [1] standard (@0.14)  
#>  fansi         0.4.2   2021-01-15 [1] CRAN (R 4.0.2)    
#>  fs            1.5.0   2020-07-31 [1] standard (@1.5.0) 
#>  future      * 1.21.0  2020-12-10 [1] CRAN (R 4.0.2)    
#>  globals       0.14.0  2020-11-22 [1] CRAN (R 4.0.2)    
#>  glue          1.4.2   2020-08-27 [1] standard (@1.4.2) 
#>  highr         0.8     2019-03-20 [1] standard (@0.8)   
#>  htmltools     0.5.1.1 2021-01-22 [1] CRAN (R 4.0.2)    
#>  knitr         1.31    2021-01-27 [1] CRAN (R 4.0.2)    
#>  lifecycle     1.0.0   2021-02-15 [1] CRAN (R 4.0.2)    
#>  listenv       0.8.0   2019-12-05 [1] CRAN (R 4.0.2)    
#>  magrittr      2.0.1   2020-11-17 [1] standard (@2.0.1) 
#>  parallelly    1.24.0  2021-03-14 [1] CRAN (R 4.0.2)    
#>  pillar        1.6.0   2021-04-13 [1] CRAN (R 4.0.2)    
#>  pkgconfig     2.0.3   2019-09-22 [1] standard (@2.0.3) 
#>  purrr         0.3.4   2020-04-17 [1] standard (@0.3.4) 
#>  reprex        2.0.0   2021-04-02 [1] CRAN (R 4.0.2)    
#>  rlang         0.4.10  2020-12-30 [1] CRAN (R 4.0.2)    
#>  rmarkdown     2.7     2021-02-19 [1] CRAN (R 4.0.2)    
#>  sessioninfo   1.1.1   2018-11-05 [1] standard (@1.1.1) 
#>  stringi       1.5.3   2020-09-09 [1] standard (@1.5.3) 
#>  stringr       1.4.0   2019-02-10 [1] standard (@1.4.0) 
#>  styler        1.4.1   2021-03-30 [1] CRAN (R 4.0.2)    
#>  tibble        3.1.1   2021-04-18 [1] CRAN (R 4.0.3)    
#>  utf8          1.2.1   2021-03-12 [1] CRAN (R 4.0.2)    
#>  vctrs         0.3.7   2021-03-29 [1] CRAN (R 4.0.3)    
#>  withr         2.4.2   2021-04-18 [1] CRAN (R 4.0.3)    
#>  xfun          0.22    2021-03-11 [1] CRAN (R 4.0.2)    
#>  yaml          2.2.1   2020-02-01 [1] standard (@2.2.1) 
#> 
#> [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

this is currently called in check_future_plan and tested in test_inference.R

My understanding is that greta was trying to steer users away from using this anyway, so i'm not sure if we need to change anything here? We might want to use tryCatch to capture the error and send our own one. On the other hand, I feel like that is interfering with the planned deprecation of future.

What are your thoughts, @goldingn ?

@njtierney
Copy link
Collaborator Author

capture the warning in

plan(multiprocess)
with a tryCatch to capture this specific warning

#> Warning: Strategy 'multiprocess' is deprecated in future (>= 1.20.0). Instead,
#> explicitly specify either 'multisession' or 'multicore'. In the current R
#> session, 'multiprocess' equals 'multisession'.

mute this, and then otherwise send through the warning.

and this would go into the tests in testthat.

@njtierney njtierney self-assigned this May 4, 2021
@njtierney njtierney added the 0.4.0 label Jul 2, 2021
@njtierney njtierney added this to the 0.4.0 milestone Jul 2, 2021
@njtierney njtierney removed the 0.4.0 label Jul 2, 2021
@njtierney njtierney modified the milestones: 0.4.0, 0.3.2 Jul 8, 2021
@njtierney njtierney modified the milestones: 0.4.0, 0.4.1 Nov 26, 2021
@njtierney njtierney removed the Up Next label Mar 30, 2022
@HenrikBengtsson
Copy link

mute this, and then otherwise send through the warning.

I highly recommend removing all references and use of multiprocess, because it will eventually become defunct, and the package will fail R CMD check. It would also help me speed up the deprecation process of 'multiprocess', as otherwise I have to explain to CRAN why a new release of future breaks greta.

@njtierney
Copy link
Collaborator Author

OK awesome, thanks @HenrikBengtsson ! I'm working through this in #537 - currently debugging some errors, I think I've just slightly mucked up some of the logic of the testing.

@njtierney
Copy link
Collaborator Author

This has been resolved in #537

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants