diplomat.wx_gui.probability_displayer.ProbabilityDisplayer
- class diplomat.wx_gui.probability_displayer.ProbabilityDisplayer(*args: Any, **kwargs: Any)[source]
Bases:
ControlA custom wx.Control which displays a list of probabilities in the form of a line segment plot. Uses native colors so as to match other native widgets in the UI.
- __init__(parent, data: ndarray = None, bad_locations: ndarray = None, text: str = None, height: int = 50, visible_probs: int = 100, style=wx.BORDER_DEFAULT, name='ProbabilityDisplayer', **kwargs)[source]
Construct a new ProbabilityDisplayer….
- Parameters:
parent – The parent widget.
data – The probability data, a 1D numpy array of number type values.
text – The text to display in the top left corner of this probability display, or None to display no text.
w_id – wx ID of the window, and integer. Defaults to wx.ID_ANY.
height – The minimum height of the probability display. Defaults to 50 pixels.
visible_probs – The max number of probabilities to show on screen at once. Defaults to 100.
pos – WX Position of control. Defaults to wx.DefaultPosition.
size – WX Size of the control. Defaults to wx.DefaultSize.
style – WX Control Style. See wx.Control docs for possible options. (Defaults to wx.BORDER_DEFAULT).
validator – WX Validator, defaults to
name – WX internal name of widget.
Methods
DoGetBestSize()__init__(parent[, data, bad_locations, ...])Construct a new ProbabilityDisplayer....
Get the list of indexes specifying poorly annotated locations during the video.
get_data()Get all the data.
get_data_at(frame)Get the data at a given index or frame within the probability display.
Get the current location of the probability display, or the index to which the arrow is pointing.
get_next_bad_location([location, ...])Get the next bad location based on the current location in the probability display.
get_prev_bad_location([location, ...])Get the previous bad location based on the current location in the probability display.
get_prior_modified_user_locations()get_text()Get the display text for this probability display.
Get the current user modified locations...
on_draw(dc)For internal use! Executed on drawing update, redraws the probability display.
on_paint(event)PRIVATE: Triggered on a wx paint event, redraws the probability display...
set_bad_locations(locations)Set the list of indexes specifying poorly annotated locations during the video.
set_data(data)Set all of the data.
set_data_at(frame, value)Set the data at the given frame to the given value.
set_location(location)Set the current location of the probability display, or the index to which the arrow is pointing.
set_prior_modified_user_locations(value)set_segment_fix_frames(value)set_segment_starts(value)set_text(value)Set the display text of this probability display.
Attributes
DEF_HEIGHTMIN_PROB_STEPTOP_PADDINGTRIANGLE_SIZEVISIBLE_PROBS- get_bad_locations() ndarray[source]
Get the list of indexes specifying poorly annotated locations during the video.
- Returns:
A read only view of the numpy array storing indexes of poorly annotated frames.
- get_data() ndarray[source]
Get all the data.
- Returns:
Numpy array of numbers, the data of this probability display. The returned array is a read only view…
- get_data_at(frame: int) float[source]
Get the data at a given index or frame within the probability display.
- Parameters:
frame – The index or frame to get the probability data of.
- Returns:
A float, being the data at the given frame.
- get_location() int[source]
Get the current location of the probability display, or the index to which the arrow is pointing.
- Returns:
A integer, being the frame or index of the currently pointed to location.
- get_next_bad_location(location: int = None, orig_location=None, moves_done=0) int[source]
Get the next bad location based on the current location in the probability display.
- Returns:
An integer, the index of the nearest next bad location.
- get_prev_bad_location(location: int = None, orig_location=None, moves_done=0) int[source]
Get the previous bad location based on the current location in the probability display.
- Returns:
An integer, the index of the nearest previous bad location.
- get_text() str[source]
Get the display text for this probability display.
- Returns:
A string, being the display text.
- on_draw(dc: wx.DC)[source]
For internal use! Executed on drawing update, redraws the probability display. Expects a wx.DC for drawing to.
- on_paint(event: wx.PaintEvent)[source]
PRIVATE: Triggered on a wx paint event, redraws the probability display…
- set_bad_locations(locations: ndarray)[source]
Set the list of indexes specifying poorly annotated locations during the video.
- Parameters:
locations – List of integers, the indexes of poorly annotated locations within the video.
- set_data(data: ndarray)[source]
Set all of the data.
- Parameters:
data – Numpy array of numbers, will be copied over into the internal data store and displayed on next redraw.
- set_data_at(frame: int, value: float)[source]
Set the data at the given frame to the given value.
- Parameters:
frame – The frame or index to set the data value at.
value – A float or number, the value to assign at the data point.