Reporting Information
Handlers provide a way to report information about the current task. Handlers include “error”, “warning”, “progress”, and “status”. These can be turned on and off using the igraph.verbose command, with exception to the error handler, which must remain on since it’s pertinent to understand why a statement failed. By default the warning handler is turned on and the progress and status handlers are left off. The warning handler should stay on as it provides information about potentially undesired or unexpected behavior, but it can be turned off in case there’s a reason to silence them. The progress and status handlers provide non-problematic information about a currently running process; progress reports how far along a process is while status gives other useful information about the process that can’t readily be represented as a percentage. These are off by default since they could be considered clutter when running many quicker functions. They can, however, be useful for longer running tasks. For now we’ll turn them on to see them in action:
igraph.verbose("progress", true);
igraph.verbose("status", true);
Note: not all functions provide progress reporting.
Inside this live script, progress reports appear on multiple lines but outside of live scripts progress will update on a single line.
graph = igraph.randgame("BarabasiBag", nNodes = 15);
graph = igraph.rewire(graph);
Progress: [--------------------] 0%
Progress: [####################] 100%
The Barabasi Bag random graph game does not provide progress reporting but the rewire function does.
Progress and status can be turned back off with the verbose command:
igraph.verbose("progress", false);
graph = igraph.rewire(graph);