Skip to content

update for cross package progress support #336

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions docs/src/basics/common_solver_opts.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,16 @@ 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.

* `progress`: Turns on/off the Juno progressbar. Default is false.
* `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
Expand Down
28 changes: 2 additions & 26 deletions docs/src/features/progress_bar.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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).