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

How can I disable the progress bar ? #167

Closed
statquant opened this issue Aug 9, 2019 · 4 comments
Closed

How can I disable the progress bar ? #167

statquant opened this issue Aug 9, 2019 · 4 comments
Labels

Comments

@statquant
Copy link

Hello, is there a way to disable the progress bar , if not would you kindly add an option like options(clustermq.progress = FALSE). I can PR if you point me to it

@mschubert
Copy link
Owner

mschubert commented Aug 9, 2019

Have you tried

Q(..., verbose=FALSE)?

?Q states

verbose: Print status messages and progress bar (default: TRUE)

@statquant
Copy link
Author

Sorry I should have said that I use foreach

@mschubert
Copy link
Owner

Looks like currently your only option is to suppressMessages(), but we should probably support the .verbose argument in foreach.

Should be as simple as:

--- a/R/foreach.r
+++ b/R/foreach.r
@@ -56,7 +56,8 @@ cmq_foreach = function(obj, expr, envir, data) {
         data$pkgs = unique(c(data$pkgs, obj$packages))
     }

-    result = do.call(Q_rows, c(list(df=args_df, fun=fun), data))
+    result = do.call(Q_rows, c(list(df=args_df, fun=fun, verbose=obj$verbose),
+                               data))

     accum = foreach::makeAccum(it)
     accum(result, tags=seq_along(result))

Related: #164

@mschubert
Copy link
Owner

Applying the suggested patch above will not only print clustermq messages, but also low-level foreach messages.

I'd argue we are not interested in those.

I checked whether I could solve this with:

  • Different levels of .verbose, e.g. 1 for clustermq messages and 2 for foreach messages. This does not work, because foreach checks that the type is logical
  • By adding an additional .progress parameter to foreach, which does not work because it does not support ...

Hence, if you want to suppress the progress bar, you can still wrap your call in suppressMessages(...).

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

No branches or pull requests

2 participants