An iteration history printer
Project description
IterationPrinter: A simple iteration history printer
When using iterative numerical algorithms it is common
to print after each iteration a message so that a user
can monitor convergence and catch any bugs.
As an example, demo.py
implements a simple bisection algorithm
for computing the square root of two.
The following is the output using this library:
Usage
from iterprinter import IterationPrinter
# Initialize the printer by passing formatting information each column
printer = IterationPrinter(it = '4d', obj = '16.6e')
# Print a header for the table
printer.print_header(it = 'iter', obj = 'objective')
# Print a normal line of history
printer.print_iter(it = 0, obj = 5e3 )
# If a particular field is not provided, the column is left empty
printer.print_iter(it = 1)
For a more complete example, see demo.py
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
iterprinter-0.1.2.tar.gz
(2.7 kB
view details)
File details
Details for the file iterprinter-0.1.2.tar.gz
.
File metadata
- Download URL: iterprinter-0.1.2.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 272aa20b0e2ed000fb8dd7b7aa6bfd9caaf64857e049c1e0adc682f06983fe32 |
|
MD5 | 3abba11da82a6766ac6f91fe1f9e287f |
|
BLAKE2b-256 | 2b00597195657d3bc4a63610550eb5156ed1c67dabdb33c4735069673d9b6220 |