File: progress.md

package info (click to toggle)
bornagain 23.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 103,948 kB
  • sloc: cpp: 423,131; python: 40,997; javascript: 11,167; awk: 630; sh: 318; ruby: 173; xml: 130; makefile: 51; ansic: 24
file content (28 lines) | stat: -rw-r--r-- 548 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
+++
title = "Progress monitor"
weight = 81
+++

### Terminal progress monitor

To monitor progress of a time-consuming simulation, use
```python
simulation.setTerminalProgressMonitor()
simulation.simulate()
```

While the simulation is running, progress will be printed in the form
```
... 17%
```

To prevent problems if the script is run in batch mode,
use the conditional
```python
if not "__no_terminal__" in globals():
    simulation.setTerminalProgressMonitor()
```

This is used for example in

{{< show-ex file="scatter2d/FindPeaks.py" >}}