anesthetic.gui package

Graphical user interface for inspecting nested sampling runs.

anesthetic.gui.plot module

Main plotting tools.

class anesthetic.gui.plot.Beta(beta, D_KL, fig, gridspec, action)[source]

Bases: Slider

Slider controlling inverse temperature of the posterior points.

set_text(beta)[source]

Set the text at end of slider.

Parameters:
betafloat

Current inverse temperature of posterior points stage

class anesthetic.gui.plot.Evolution(logX, fig, gridspec, action)[source]

Bases: Slider

Slider controlling the evolution stage of the live points.

set_text(logL, n)[source]

Set the text at end of slider.

Parameters:
logLfloat

Current loglikelihood of evolution stage

nint

Current number of live points of evolution stage

class anesthetic.gui.plot.Higson(fig, gridspec)[source]

Bases: Widget

Higson plot as shown in https://arxiv.org/abs/1703.09701 .

Attributes:
curvematplotlib.lines.Line2D

points currently plotted as a curve.

pointmatplotlib.lines.Line2D

large indicator point currently plotted on the curve.

reset_range()[source]

Reset the ranges of the higson plot.

update(logX, LX, i)[source]

Update the line and the point in the higson plot.

Parameters:
logXarray-like

log-volume compression values to plot

LXarray-like

Likelihood * volume compression

iint

Current location of higson point

class anesthetic.gui.plot.RunPlotter(samples, params=None)[source]

Bases: object

Construct a control panel of information on a nested sampling run.

Parameters:
samplesanesthetic.samples.NestedSamples

The root string for the chains files to be used, or a set of nested samples.

Attributes:
samplesanesthetic.samples.NestedSamples

Object for extracting nested sampling data from chains files.

figmatplotlib.figure.Figure

Reference to the underlying figure

triangleanesthetic.gui.widgets.TrianglePlot

Corner plot of live or posterior samples.

betaanesthetic.gui.plot.Beta

Slider selecting the posterior inverse temperature.

evolutionanesthetic.gui.plot.Evolution

Slider selecting the live iteration.

higsonanesthetic.gui.plot.Higson

Higson plot of posterior weights.

resetanesthetic.gui.widgets.Button

Button that resets the parameter ranges.

reloadanesthetic.gui.widgets.Button

Button that reloads the files.

typeanesthetic.gui.widgets.RadioButtons

Radio buttons that selects whether to plot live or posteriors.

param_choiceanesthetic.gui.widgets.CheckButtons

Checkbox that selects which parameters to plot.

points(label)[source]

Get sample coordinates from nested sampling samples.

Parameters:
labelstr

label indicating the coordinate to extract.

Returns:
array-like:

sample ‘label’-coordinates.

redraw(_)[source]

Redraw the triangle plot upon parameter updating.

reload_file(_)[source]

Reload the data from file.

reset_range(_)[source]

Reset the parameter ranges.

update(_)[source]

Update all the plots upon slider changes.

anesthetic.gui.widgets module

Widget wrappers to matplotlib.

These extend the matplotlib widgets by plotting themselves onto an axis and storing a reference to both the widget object and the axis on which they are plotted.

class anesthetic.gui.widgets.Button(fig, gridspec, action, text)[source]

Bases: Widget

Push button that performs an action.

Parameters:
action: func

What should be run upon clicking the button.

text: str

Overlay text on the button.

Attributes:
button: :class:`matplotlib.widgets.Button`

matplotlib Button.

class anesthetic.gui.widgets.CheckButtons(fig, gridspec, labels, action)[source]

Bases: LabelsWidget

Set of checkboxes.

Defaults to choosing the only the first label at start.

Parameters:
action: func

What should be done upon checking the box.

Attributes:
buttons: :class:`matplotlib.widgets.CheckButtons`

matplotlib CheckButtons.

class anesthetic.gui.widgets.LabelsWidget(fig, gridspec, labels)[source]

Bases: Widget

Widget with labels to choose from.

Parameters:
labels: list(str)

Set of labels to be tied to Widget.

Attributes:
labels: list(str)

Set of labels on Widget.

class anesthetic.gui.widgets.RadioButtons(fig, gridspec, labels, action)[source]

Bases: LabelsWidget

Set of radio selection choices.

Parameters:
labels: list(str))
Attributes:
buttons: :class:`matplotlib.widgets.RadioButtons`

matplotlib RadioButtons.

class anesthetic.gui.widgets.Slider(fig, gridspec, action, text, valmin, valmax, valinit, orientation)[source]

Bases: Widget

Choose a parameter via a slider widget.

Parameters:
action: func

What should be done upon altering the slider.

text: str

Text at the start of the slider.

valmin, valmax, valinit: float

Range and initial value for the slider.

orientation: str

Orientation for slider (‘horizontal’ or ‘vertical’).

Attributes:
slider: :class:`matplotlib.widgets.Slider`

matplotlib Slider.

reset_range(valmin=None, valmax=None)[source]

Reset the range of the slider.

Kwargs:
valmin, valmax: (float), optional:

The new limits to the slider.

set_text(text)[source]

Set the text at the end of the slider.

Parameters:
text: str

Text to be chosen

class anesthetic.gui.widgets.TrianglePlot(fig, gridspec)[source]

Bases: Widget

Triangle plot widget as exemplified by getdist and corner.py.

For other examples of these plots, see: https://getdist.readthedocs.io https://corner.readthedocs.io

Attributes:
ax: :class:`pandas.DataFrame`(:class:`matplotlib.axes.Axes`)

Mapping from pairs of parameters to axes for plotting.

draw(params, labels={})[source]

Draw a new triangular grid for list of parameters.

Parameters:
params: list(str)

params for the triangular grid.

reset_range()[source]

Reset the range of each grid.

update(f)[source]

Update the points in the triangle plot using f function.

Parameters:
f: func: str -> array(float)

this function should take in a parameter label i, and return an array-like object of the i-coordinate of the samples

class anesthetic.gui.widgets.Widget(fig, gridspec)[source]

Bases: object

Base class for anesthetic gui widgets.

Stores a reference to the underlying figure, the gridspec that the widget is placed at and the axes of the widget.

Parameters:
fig: :class:`matplotlib.figure.Figure`

Figure for drawing widget on.

gridspec: matplotlib.gridspec.GridSpec

Specification for where to draw in the figure. Technically could be any argument that can be passed to matplotlib.figure.Figure.add_subplot().

Attributes:
fig: :class:`matplotlib.figure.Figure`

Figure for drawing widget on.

gridspec: matplotlib.gridspec.GridSpec

Specification for where to draw in the figure. Technically could be any argument that can be passed to matplotlib.figure.Figure.add_subplot().

ax: :class:`matplotlib.axes.Axes`

Axes of widget.