You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been unable to get text progress bars (or really any progressr handler) to display within a Jupyter notebook. Given the following test case in a Jupyter environment, nothing displays when using progressr, though displays as expected if using utils::txtProgressBar. Both scenarios work just fine in RStudio.
library(progressr)
handlers('txtprogressbar')
test_slow_sum<-function(x) {
# If we uncomment txtProgressBar lines, it works just as expected. But if we use progressr, nothing is displayed.# pb <- txtProgressBar(min = 0, max = length(x), initial = 0) # p <- progressr::progressor(along = x)for (kkin seq_along(x)) {
Sys.sleep(0.1)
# setTxtProgressBar(pb,kk)# p(kk)
}
}
with_progress(test_slow_sum(1:10))
Screen.Recording.2024-06-10.at.13.41.52.mov
The text was updated successfully, but these errors were encountered:
imathews
changed the title
Text progress bar not showing up in jupyter notebook
Text progress bar not showing up in Jupyter notebook
Jun 10, 2024
Unfortunately that doesn't seem to work either. I've put together a sample colab notebook to reproduce this easily (I'm fairly certain colab is using the same IRKernel as Jupyter under the hood to communicate with R, at the least we see the same behavior).
One other piece of information is that calling a simple cat("\r", val) within the for loop doesn't yield any output until the end, though if we add a flush.console() after cat(), we can see the output updated live.
I tried writing my own custom handler to leverage this behavior, though was unsuccessful - likely due to my limited knowledge here.
I've been unable to get text progress bars (or really any progressr handler) to display within a Jupyter notebook. Given the following test case in a Jupyter environment, nothing displays when using progressr, though displays as expected if using
utils::txtProgressBar
. Both scenarios work just fine in RStudio.Screen.Recording.2024-06-10.at.13.41.52.mov
The text was updated successfully, but these errors were encountered: