sboxUv2.display package

Functions and utilities to help obtain more and easier to parse information through sophisticated formatting and graph generation.

Submodules

sboxUv2.display.output module

class sboxUv2.display.output.Chronograph(title)[source]

Bases: object

class sboxUv2.display.output.Experiment(title: str)[source]

Bases: object

The purpose of this class is to simplify the task of generating a pretty output in a terminal that contains more automatically derived information.

To use it, simply rely on the with statement:

Example

with Experiment(“your experiment title”):

section(“the first part”) <your code> section(“the second part (which is bigger)”) subsection(“the first part of the second part”) <your code>

When running your code, the title of the experiment will be displayed, and the sections titles will be highlighted for ease of reading.

The runtime of each section and subsection is also displayed at the end of each of these.

section(title: str) None[source]
subsection(title: str) None[source]
sboxUv2.display.output.pprint(*args)[source]
sboxUv2.display.output.section(title: str) None[source]
sboxUv2.display.output.subsection(title: str) None[source]

sboxUv2.display.pollock module

class sboxUv2.display.pollock.TableCursor(ax, values_function, desc)[source]

Bases: object

A cross hair cursor.

Its implementation is largely taken from the matplotlib tutorial (see https://matplotlib.org/stable/gallery/event_handling/cursor_demo.html#sphx-glr-gallery-event-handling-cursor-demo-py).

on_mouse_move(event)[source]
set_cross_hair_visible(visible)[source]
sboxUv2.display.pollock.bct_interactive_view(s, cmap='coolwarm', vmin=0, vmax=32, absolute=True, show_only=None)[source]
sboxUv2.display.pollock.ddt_interactive_view(s, cmap='coolwarm', vmin=0, vmax=10, show_only=None)[source]
sboxUv2.display.pollock.fbct_interactive_view(s, cmap='coolwarm', vmin=0, vmax=16, absolute=True, show_only=None)[source]
sboxUv2.display.pollock.interactive_distribution_comparison(spec, in_length, out_length, expected_distrib, title='T', name='S', l_min=None, l_max=None, y_log_scale=True)[source]
sboxUv2.display.pollock.interactive_distribution_comparison_bct(s, y_log_scale=True)[source]
sboxUv2.display.pollock.interactive_distribution_comparison_ddt(s, y_log_scale=True)[source]
sboxUv2.display.pollock.interactive_distribution_comparison_lat(s, y_log_scale=True)[source]
sboxUv2.display.pollock.lat_interactive_view(s, cmap='coolwarm', vmin=None, vmax=40, absolute=True, show_only=None)[source]
sboxUv2.display.pollock.table_interactive_view(table, title='Table', desc='v', cmap='coolwarm', vmin=0, vmax=20)[source]

Stops the execution flow and displays a new window containing a Pollock-style (in the sense of [C:BirPer15]) representation of a table.

The table is assumed to be a 2-dimensional array containing integers. We associate a color to each value using the colormap cmap. Then, a 2D picture is generated representing the content of the table.

A cross-hair cursor is displayed where the mouse, and the values of the coordinates are displayed under the picture. To describe the value at a given position, you need to specify the desc input. The cursor is handled using the TableCursor class.