From 4a7bfd984995fc6ed551fc9fb25f28c4a7ec05b9 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Sun, 8 Mar 2020 21:42:13 -0400 Subject: [PATCH 1/2] update for cross package progress support --- docs/src/basics/common_solver_opts.md | 7 ++++--- docs/src/features/progress_bar.md | 28 ++------------------------- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/docs/src/basics/common_solver_opts.md b/docs/src/basics/common_solver_opts.md index f7a9cd4699..6b6ebdb1e5 100644 --- a/docs/src/basics/common_solver_opts.md +++ b/docs/src/basics/common_solver_opts.md @@ -202,12 +202,13 @@ explanations of the timestepping algorithms, see the Defaults to true. * `merge_callbacks`: Toggles whether to merge `prob.callback` with the `solve` keyword argument `callback`. Defaults to `true`. - + ## Progress Monitoring -These arguments control the usage of the progressbar in the Juno IDE. +These arguments control the usage of the progressbar. In Juno this will use the +special Juno progress bar, otherwise it'll use the REPL progress setup. -* `progress`: Turns on/off the Juno progressbar. Default is false. +* `progress`: Turns on/off the progressbar. Default is false. * `progress_steps`: Numbers of steps between updates of the progress bar. Default is 1000. * `progress_name`: Controls the name of the progressbar. Default is the name diff --git a/docs/src/features/progress_bar.md b/docs/src/features/progress_bar.md index 5b5a4f6419..0a777d9d6c 100644 --- a/docs/src/features/progress_bar.md +++ b/docs/src/features/progress_bar.md @@ -1,6 +1,6 @@ # Progress Bar Integration -DifferentialEquations.jl integrates with the Juno progress bar in order to make +DifferentialEquations.jl integrates with the progress bars in order to make long calculations more manageable. By default this feature is off for ODE and SDE solvers, but can be turned on via the keyword argument `progressbar=true`. The progress bar updates every `progress_steps` timesteps, which has a default @@ -12,30 +12,6 @@ giving a high upper bound. Note that the progressbar also includes a time estimate. This time-estimate is provided by linear extrapolation for how long it has taken to get to what percentage. For adaptive timestepping methods this should only be used as a rough estimate since -the timesteps may (and will) change. By scrolling over the progressbar one will +the timesteps may (and will) change. In Juno, scrolling over the progressbar one will also see the current timestep. This can be used to track the solution's progress and find tough locations for the solvers. - -## Using Progress Bars Outside Juno - -To use the progress bars outside of Juno, use [TerminalLoggers.jl](https://github.com/c42f/TerminalLoggers.jl). -The following is an example for redirecting the logging to the terminal: - -```julia -using Logging: global_logger -using TerminalLoggers: TerminalLogger -global_logger(TerminalLogger()) - -using OrdinaryDiffEq - -solve( - ODEProblem((u, p, t) -> (sleep(0.01); -u), 1.0, nothing), - Euler(); - dt = 0.5, - tspan = (0.0, 1000.0), - progress = true, - progress_steps = 1, -) -``` - -To do this by default, [follow these direction to add TerminalLogging to your startup.jl](https://c42f.github.io/TerminalLoggers.jl/stable/#Installation-and-setup-1). From 8698005dcefb29859160c81ff94bae5e0d934f01 Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Sun, 8 Mar 2020 22:22:50 -0400 Subject: [PATCH 2/2] add logger kwarg --- docs/src/basics/common_solver_opts.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/src/basics/common_solver_opts.md b/docs/src/basics/common_solver_opts.md index 6b6ebdb1e5..d5de7bed2d 100644 --- a/docs/src/basics/common_solver_opts.md +++ b/docs/src/basics/common_solver_opts.md @@ -205,10 +205,13 @@ explanations of the timestepping algorithms, see the ## Progress Monitoring -These arguments control the usage of the progressbar. In Juno this will use the -special Juno progress bar, otherwise it'll use the REPL progress setup. +These arguments control the usage of the progressbar. * `progress`: Turns on/off the progressbar. Default is false. +* `logger`: Controls what logger is used. In Juno this will default to `nothing` + and use the special Juno progress bar, otherwise it'll use the REPL progress + setup provided by TerminalLoggers.jl. A custom logger can be provided to override + these settings. * `progress_steps`: Numbers of steps between updates of the progress bar. Default is 1000. * `progress_name`: Controls the name of the progressbar. Default is the name