4.7.12 pde.tools.output module
Python functions for handling output.
Returns a class that behaves as progress bar. |
|
Displays a progress bar when iterating. |
|
Checks whether we are in a jupyter notebook. |
|
Class that writes text line to stdout. |
|
Class that writes text lines as html in a jupyter cell. |
- class BasicOutput(stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]
Bases:
OutputBaseClass that writes text line to stdout.
- Parameters:
stream – The stream where the lines are written
- class JupyterOutput(header='', footer='')[source]
Bases:
OutputBaseClass that writes text lines as html in a jupyter cell.
- Parameters:
- display_progress(iterator, total=None, enabled=True, **kwargs)[source]
Displays a progress bar when iterating.
- Parameters:
- Returns:
A class that behaves as the original iterator, but shows the progress alongside iteration.
- get_progress_bar_class(fancy=True)[source]
Returns a class that behaves as progress bar.
This either uses classes from the optional tqdm package or a simple version that writes dots to stderr, if the class it not available.
- Parameters:
fancy (bool) – Flag determining whether a fancy progress bar should be used in jupyter notebooks (if
ipywidgetsis installed)