anesthetic.gui package

Submodules

anesthetic.gui.plot module

Main plotting tools.

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

Bases: anesthetic.gui.widgets.Slider

Slider controlling the evolution stage of the live points.

Methods

__call__() Return the current iteration as an integer.
reset_range([valmin, valmax]) Reset the range of the slider.
set_text(logL, n) Set the text at end of slider.
set_text(logL, n)[source]

Set the text at end of slider.

Parameters:
logL: float

Current loglikelihood of evolution stage

n: int

Current number of live points of evolution stage

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

Bases: anesthetic.gui.widgets.Widget

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

Attributes:
curve: matplotlib.lines.Line2D

points currently plotted as a curve.

point: matplotlib.lines.Line2D

large indicator point currently plotted on the curve.

Methods

reset_range() Reset the ranges of the higson plot.
update(logX, LX, i) Update the line and the point in the higson plot.
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:
logX: array-like

log-volume compression values to plot

LX: array-like

Likelihood * volume compression

i: int

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:
samples: anesthetic.samples.NestedSamples

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

Attributes:
samples: anesthetic.samples.NestedSamples

Object for extracting nested sampling data from chains files.

fig: matplotlib.figure.Figure

Reference to the underlying figure

triangle: anesthetic.gui.widgets.TrianglePlot

Corner plot of live or posterior samples.

temperature: anesthetic.gui.plot.Temperature

Slider selecting the posterior temperature.

evolution: anesthetic.gui.plot.Evolution

Slider selecting the live iteration.

higson: anesthetic.gui.plot.Higson

Higson plot of posterior weights.

reset: anesthetic.gui.widgets.Button

Button that resets the parameter ranges.

reload: anesthetic.gui.widgets.Button

Button that reloads the files.

type: anesthetic.gui.widgets.RadioButtons

Radio buttons that selects whether to plot live or posteriors.

param_choice: anesthetic.gui.widgets.CheckButtons

Checkbox that selects which parameters to plot.

Methods

points(label) Get sample coordinates from nested sampling samples.
redraw(_) Redraw the triangle plot upon parameter updating.
reload_file(_) Reload the data from file.
reset_range(_) Reset the parameter ranges.
update(_) Update all the plots upon slider changes.
points(label)[source]

Get sample coordinates from nested sampling samples.

Parameters:
label: str

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.

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

Bases: anesthetic.gui.widgets.Slider

Logarithmic slider controlling temperature of the posterior points.

Methods

__call__() Return the current temperature.
reset_range([valmin, valmax]) Reset the range of the slider.
set_text(kT) Set the text at end of slider.
set_text(kT)[source]

Set the text at end of slider.

Parameters:
kT: float

Current temperature of posterior points stage

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: anesthetic.gui.widgets.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: matplotlib.widgets.Button

matplotlib Button.

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

Bases: anesthetic.gui.widgets.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: matplotlib.widgets.CheckButtons

matplotlib CheckButtons.

Methods

__call__() Get current status of the check boxes.
class anesthetic.gui.widgets.LabelsWidget(fig, gridspec, labels)[source]

Bases: anesthetic.gui.widgets.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: anesthetic.gui.widgets.LabelsWidget

Set of radio selection choices.

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

matplotlib RadioButtons.

Methods

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

Bases: anesthetic.gui.widgets.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: matplotlib.widgets.Slider

matplotlib Slider.

Methods

__call__() Return the float value in the slider.
reset_range([valmin, valmax]) Reset the range of the slider.
set_text(text) Set the text at the end of the 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: anesthetic.gui.widgets.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: pandas.DataFrame(matplotlib.axes.Axes)

Mapping from pairs of parameters to axes for plotting.

Methods

draw(labels[, tex]) Draw a new triangular grid for list of parameters labels.
reset_range() Reset the range of each grid.
update(f) Update the points in the triangle plot using f function.
draw(labels, tex={})[source]

Draw a new triangular grid for list of parameters labels.

Parameters:
labels: list(str)

labels 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: 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: (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: matplotlib.axes.Axes

Axes of widget.

Module contents

Graphical user interface for inspecting nested sampling runs.