zero.display module

Rich display system

class zero.display.BaseGroupPlotter(legend_groups=True, hidden_group_names=None, **kwargs)[source]

Bases: object

abstract plot_groups(groups)[source]
class zero.display.BasePlotter[source]

Bases: object

abstract plot(functions, **kwargs)[source]
abstract show()[source]
class zero.display.BodePlotter(scale_db=True, xlim=None, mag_ylim=None, phase_ylim=None, xlabel=None, ylabel_mag=None, ylabel_phase=None, db_tick_major_step=20, db_tick_minor_step=10, phase_tick_major_step=45, phase_tick_minor_step=15, **kwargs)[source]

Bases: zero.display.MplGroupPlotter

property ax1
property ax2
property figure
plot(functions, **kwargs)[source]
class zero.display.EquationDisplay(lhs, rhs, elements)[source]

Bases: zero.display.TableFormatter

align_to(search, sequence)[source]

Line up elements in sequence to search character or string

format_coefficient_latex(coefficient)[source]

Format equation coefficient

format_coefficient_text(coefficient)[source]

Format equation coefficient

format_exponent_latex(number)[source]

Format number in LaTeX

format_exponent_text(number)[source]

Format number in text

format_rhs(rhs)[source]

Format right hand side number

property row_cell_groups
class zero.display.MatplotlibPlotter(figure=None, title=None, legend=True, legend_loc='best', **kwargs)[source]

Bases: zero.display.BasePlotter

property figure
save(path, **kwargs)[source]

Save specified figure to specified path (path can be file object or string path).

show(tight_layout=True)[source]
class zero.display.MatrixDisplay(lhs, middle, rhs, headers)[source]

Bases: zero.display.TableFormatter

format_cell(cell)[source]

Override parent

format_cell_html(cell)[source]
format_cell_text(cell)[source]
property row_cell_groups
class zero.display.MplGroupPlotter(**kwargs)[source]

Bases: zero.display.MatplotlibPlotter, zero.display.BaseGroupPlotter

Provides interface for plotting grouped functions.

plot_groups(groups)[source]
class zero.display.NodeGraph(circuit)[source]

Bases: object

input_shapes = {'current': 'pentagon', 'noise': 'ellipse', 'voltage': 'box'}
node_graph()[source]

Create Graphviz node graph

view_pdf()[source]

View the graph as a PDF

class zero.display.OpAmpCurrentNoisePlotter(**kwargs)[source]

Bases: zero.display.OpAmpNoisePlotter

noise(opamp)[source]
class zero.display.OpAmpGainPlotter(frequencies=None, fstart=None, fstop=None, npoints=1000, title='Open loop gain')[source]

Bases: zero.display.BodePlotter

plot(opamps)[source]
response(opamp)[source]
show()[source]
class zero.display.OpAmpNoisePlotter(title, frequencies=None, fstart=None, fstop=None, npoints=1000)[source]

Bases: zero.display.SpectralDensityPlotter

abstract noise(opamp)[source]
plot(opamps)[source]
show()[source]
class zero.display.OpAmpVoltageNoisePlotter(**kwargs)[source]

Bases: zero.display.OpAmpNoisePlotter

noise(opamp)[source]
class zero.display.SpectralDensityPlotter(xlim=None, ylim=None, xlabel=None, ylabel=None, **kwargs)[source]

Bases: zero.display.MplGroupPlotter

property axis
property figure
plot(functions, **kwargs)[source]
class zero.display.TableFormatter[source]

Bases: object

Table formatter mixin

Children inheriting this class must implement the row_cell_groups method.

combine_cells(*cells)[source]

Combines the specified collections of cells into a single iterable

format_cell(cell)[source]

Default cell formatter

format_row(cells)[source]
property formatted_table

Get formatted table

get_base_power(number)[source]

Number’s base and power

abstract property row_cell_groups
property row_cells

Returns an iterable of cells for each row in the table

sanitise_cell(cell)[source]
property table

Get unformatted table

zero.display.lighten_colours(colour_cycle, factor)[source]

Lightens the given color by multiplying (1 - luminosity) by the given factor.

https://stackoverflow.com/a/49601444/2251982