visualize

Package Contents

class gui_mainWindow(QtWidgetList, isLight=True, actionOnWindowClosed=None, neverCloseWindow=False, title_window='Awesome Visualisation Tool', size=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

Main class that spawns a Qt window. Use run() to display it.

set_actionOnClose(self, actionOnWindowClosed)[source]
closeEvent(self, event)[source]
run(self, hold=False)[source]

Display the window

static hold()[source]
keyPressEvent(self, event)[source]
app
start_qt_mainloop()[source]

Starts qt mainloop, which is necessary for qt to handle events

stop_qt_mainloop()[source]

Stops qt mainloop and resumes to program

class gui_collection_exporter[source]

Bases: PyQt5.QtWidgets.QMainWindow

Simple gui that allows to export data

signal_has_exported
signal_has_reset
exportCollection(self)[source]

Export the collection

reset(self)[source]
add_data_to_collection(self, data)[source]

Add data to the collection to export

Parameters

data – Whichever type you like

set_info(self, info)[source]
set_collection(self, theCollection)[source]
class DataAnimationVisuals(id=0, window_title='Animation')[source]

Bases: PyQt5.QtWidgets.QMainWindow

Spawns a gui that includes button to create animations nicely when paired with widget_graphs_visual

SlIDER_MAXIMUM_VALUE = 500
SLIDER_MINIMUM_VALUE = 1
add_trace(self, trace_id, element_list, theTrace)[source]

Add a trace to the animation.

Parameters
  • trace_id – id of the trace

  • element_list – List of elements to save: [[OpenGL_item1, text_item1], [OpenGL_item2, text_item2], … [OpenGL_itemN, text_itemN]]

  • theTraceTraceVisual

Returns

static get_interesting_elements(element_list)[source]

Function called upon new trace creation. From a list, takes the interesting elements for animation :param element_list: :return: new_element_list

add_elementToTrace(self, trace_id, indexPoint)[source]
delete_point(self, trace_id, thePoint)[source]
reset_all(self)[source]
delete_all(self)[source]
pause_play(self)[source]
show_all(self)[source]
next_frame(self)[source]
slider_handler(self)[source]
frame_selector(self)[source]
set_refreshTime(self)[source]
is_empty(self)[source]
run(self)[source]
closeEvent(self, _)[source]
contains_trace(self, trace_id)[source]
export_picture(self)[source]
abstract export_widget(self, painter)[source]

Render scene with a painter

Parameters

painter – PyQt painter

abstract update_widget_w_animation(self, key, index, the_data_animation)[source]

What to do when a new element has to be animated. Example: self.theOpenGLWidget.set_deviceToDraw(the_data_animation.get_element_animations(0, index))

Parameters
  • key – key of the trace that has to be animated

  • index – index that has to be animated

  • the_data_animationDataAnimationTrace that has to be animated

abstract delete_key_widgets(self, key)[source]

What to do when a key has to be deleted

Parameters

key – key of the trace that has to be deleted

class GuiDataSelector(list_ListDataStruct_in, actionOnUpdate: Action_on_selector_update)[source]

Bases: PyQt5.QtWidgets.QMainWindow

theActionOnUpdate

Generate GUI

apply_filters(self, _)[source]
run(self)[source]
class Action_on_selector_update[source]
abstract selector_updated(self, selection_name, the_collection, indices_data)[source]

Action to perform once the data have been selected :param selection_name: name of the selection (deprecated ?) :param the_collection: the collection :param indices_data: indices of the data :return:

class widget_graphs_visual(theGraphs, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget element to draw a graph. The traces and graphs to draw are defined in Graphs taken as argument. This widget is linked to the excellent third-party library pyqtgraph, under MIT license

signal_must_update
signal_graph_changed
set_graph_disposition(self, indexGraph, row=1, col=1, rowspan=1, colspan=1)[source]

Change the graphs disposition.

Parameters
  • indexGraph – index of the graph to change

  • row – row where to place the graph

  • col – column where to place the graph

  • rowspan – number of rows across which the graph spans

  • colspan – number of columns across which the graph spans

Returns

__create_graph(self, idGraph)
__check_graphs(self)
on_click(self, plotDataItem, clicked_points)[source]
update_graphs(self, singleUpdate=True)[source]

This method is used to update the graph. This is fast but NOT safe (especially when working with threads). To limit the risks, please use self.signal_must_update.emit() instead.

Parameters

singleUpdate – if set to False, the graph will periodically refres each self.refreshtime

fast_update(self)[source]

Use this method to update the graph in a fast way. NOT THREAD SAFE.

exportGraphs(self)[source]

Export the graphs

export_txt(self, filename_txt)[source]
export_svg(self, filename)[source]
static export_pdf(filename_svg, filename_pdf)[source]
static export_png(filename_svg, filename_png)[source]
export_tikz(self, foldername_tikz)[source]
get_graph(self, idGraph)[source]

Get corresponding GraphVisual of the graph idGraph

keyPressEvent(self, event)[source]

What happens if a key is pressed. R: reset the axes to their default value

delete_graph(self, idGraph)[source]

Delete the graph idGraph

delete(self)[source]
get_all_graphsVisual(self)[source]

Return a dictionary {idGraph: GraphVisual}.

get_layout_buttons(self)[source]

Get the QGraphicsLayout where it’s possible to add buttons, etc.

set_actionOnClick(self, theActionOnClick)[source]

Action to perform when the graph is clicked

Parameters

theActionOnClickon_graph_click_interface

Returns

set_title(self, idGraph, titleName, **kwargs)[source]

Set title of the graph

Parameters
  • idGraph – id of the graph

  • titleName – title to set

set_article_template(self, graph_size_x=8.8, graph_size_y=4.4, legendPosition='NW')[source]

Method to set the graphs to article quality graph.

Parameters
  • graph_size_x – width of the graph in cm

  • graph_size_y – height of the graph in cm

  • legendPosition – position of the legend (NE, SE, SW, NW)

Returns

class widget_line_drawer(minWinHeight=300, minWinWidth=300, is_light=True)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget allowing to display several lines easily

signal_must_update
on_update_signal(self, listOfLines)[source]
delete_lines(self, key_id)[source]

Dele the lines :param key_id: id to delete :return:

set_lines(self, listOfLines, key_id=0, pen=None)[source]

Set the lines to display :param listOfLines: list of [x1, y1, x2, y2] corresponding to lines :param key_id: id of the trace :param pen: pen used to draw the lines :return:

paintEvent(self, event, painter=None)[source]
get_extrema_lines(self)[source]
class widget_menuButton(theParentButton)[source]

Bases: PyQt5.QtWidgets.QMenu

Same as QMenu, but integrates it behind a button more easily.

showEvent(self, QShowEvent)[source]
class widget_openGL(parent=None)[source]

Bases: PyQt5.QtWidgets.QOpenGLWidget

Interface that provides opengl capabilities. Ensures zoom, light, rotation, etc.

sizeHint(self)[source]
minimumSizeHint(self)[source]
set_deviceDrawer(self, theDeviceDrawer)[source]

Set a drawer optimeed.visualize.gui.widgets.openGLWidget.DeviceDrawerInterface.DeviceDrawerInterface

set_deviceToDraw(self, theDeviceToDraw)[source]

Set the device to draw optimeed.InterfaceDevice.InterfaceDevice

static _get_specialButtonsMapping()[source]
initializeGL(self)[source]
paintGL(self)[source]
resizeGL(self, w, h)[source]
mousePressEvent(self, event)[source]
mouseMoveEvent(self, event)[source]
keyPressEvent(self, event)[source]
wheelEvent(self, QWheelEvent)[source]
class widget_text(theText, is_light=False, convertToHtml=False)[source]

Bases: PyQt5.QtWidgets.QLabel

Widget able to display a text

set_text(self, theText, convertToHtml=False)[source]

Set the text to display

class Widget_image(image_b64)[source]

Bases: PyQt5.QtWidgets.QLabel

eventFilter(self, source, event)[source]
set_image(self, image_b64)[source]

Set new image to widget

class guiPyqtgraph(graphsVisual, **kwargs)[source]

Create a gui for pyqtgraph with trace selection options, export and action on clic choices

refreshTraceList(self)[source]

Refresh all the traces

class DeviceDrawerInterface[source]
abstract draw(self, theDevice)[source]
abstract get_init_camera(self, theDevice)[source]
keyboard_push_action(self, theKey)[source]
get_colour_scalebar(self)[source]
get_colour_background(self)[source]
get_opengl_options(self)[source]
class on_graph_click_delete(theDataLink)[source]

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On Click: Delete the points from the graph, and save the modified collection

apply(self)[source]
reset(self)[source]
graph_clicked(self, theGraphVisual, index_graph, index_trace, indices_points)[source]
get_name(self)[source]
class on_graph_click_export(theDataLink)[source]

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On click: export the selected points

graph_clicked(self, theGraphVisual, index_graph, index_trace, indices_points)[source]
reset_graph(self)[source]
get_name(self)[source]
class on_click_extract_pareto(theDataLink, max_x=False, max_y=False)[source]

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On click: extract the pareto from the cloud of points

graph_clicked(self, the_graph_visual, index_graph, index_trace, _)[source]
get_name(self)[source]
class on_graph_click_showInfo(theLinkDataGraph, visuals=None)[source]

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On click: show informations about the points (loop through attributes)

class DataInformationVisuals[source]
delete_visual(self, theVisual)[source]
add_visual(self, theVisual, theTrace, indexPoint)[source]
get_new_index(self)[source]
curr_index(self)[source]
graph_clicked(self, theGraphVisual, index_graph, index_trace, indices_points)[source]

Action to perform when a point in the graph has been clicked: Creates new window displaying the device and its informations

get_name(self)[source]
class Repr_opengl(DeviceDrawer)[source]
get_widget(self, theNewDevice)[source]
class Repr_lines(attribute_lines)[source]
get_widget(self, theNewDevice)[source]
class Repr_brut_attributes(is_light=True, convertToHtml=True, recursion_level=5)[source]
get_widget(self, theNewDevice)[source]
class Repr_image(get_base_64_from_device)[source]
get_widget(self, theNewDevice)[source]
class on_graph_click_remove_trace(theDataLink)[source]

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

graph_clicked(self, theGraphVisual, index_graph, index_trace, _)[source]
get_name(self)[source]
class on_click_copy_something(theDataLink, functionStrFromDevice)[source]

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On Click: copy something

graph_clicked(self, the_graph_visual, index_graph, index_trace, indices_points)[source]
get_name(self)[source]
class on_click_change_symbol(theLinkDataGraph)[source]

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On Click: Change the symbol of the point that is clicked

graph_clicked(self, theGraphVisual, index_graph, index_trace, indices_points)[source]
get_name(self)[source]
class on_click_measure[source]

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On Click: Measure distance. Click on two points to perform that action

graph_clicked(self, the_graph_visual, index_graph, index_trace, indices_points)[source]
reset_distance(self)[source]
display_distance(self)[source]
get_name(self)[source]
class on_graph_click_interface[source]

Interface class for the action to perform when a point is clicked

abstract graph_clicked(self, theGraphsVisual, index_graph, index_trace, indices_points)[source]

Action to perform when a graph is clicked

Parameters
  • theGraphsVisual – class widget_graphs_visual that has called the method

  • index_graph – Index of the graph that has been clicked

  • index_trace – Index of the trace that has been clicked

  • indices_points – graph Indices of the points that have been clicked

Returns

abstract get_name(self)[source]
class DataAnimationOpenGL(theOpenGLWidget, theId=0, window_title='Animation')[source]

Bases: optimeed.visualize.gui.gui_data_animation.DataAnimationVisuals

Implements DataAnimationVisuals to show opengl drawing

update_widget_w_animation(self, key, index, the_data_animation)[source]
export_widget(self, painter)[source]
delete_key_widgets(self, key)[source]
class DataAnimationOpenGLwText(*args, is_light=True, **kwargs)[source]

Bases: optimeed.visualize.gui.widgets.graphsVisualWidget.examplesActionOnClick.on_click_anim.DataAnimationOpenGL

Implements DataAnimationVisuals to show opengl drawing and text

update_widget_w_animation(self, key, index, the_data_animation)[source]
get_interesting_elements(self, devices_list)[source]
class DataAnimationLines(get_lines_method, is_light=True, theId=0, window_title='Animation')[source]

Bases: optimeed.visualize.gui.gui_data_animation.DataAnimationVisuals

Implements DataAnimationVisuals to show drawing made out of lines (widget_line_drawer)

export_widget(self, painter)[source]
delete_key_widgets(self, key)[source]
update_widget_w_animation(self, key, index, the_data_animation)[source]
get_interesting_elements(self, devices_list)[source]
class DataAnimationVisualswText(*args, **kwargs)[source]

Bases: optimeed.visualize.gui.widgets.graphsVisualWidget.examplesActionOnClick.on_click_anim.DataAnimationLines

Same as DataAnimationLines but also with text

update_widget_w_animation(self, key, index, the_data_animation)[source]
class on_graph_click_showAnim(theLinkDataGraph, theAnimation)[source]

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On click: add or remove an element to animate

graph_clicked(self, theGraphVisual, index_graph, index_trace, indices_points)[source]
get_name(self)[source]
class On_select_new_trace(theLinkDataGraphs)[source]

Bases: optimeed.visualize.gui.gui_data_selector.Action_on_selector_update

selector_updated(self, selection_name, the_collection, indices_data)[source]

Action to perform once the data have been selected :param selection_name: name of the selection (deprecated ?) :param the_collection: the collection :param indices_data: indices of the data :return:

class LinkDataGraph[source]
class _collection_linker[source]
get_collection_master(self, idToGet)[source]
is_slave(self, idToCheck)[source]
set_same_master(self, idExistingSlave, idOtherSlave)[source]
Parameters
  • idExistingSlave – id collection of the existing slave

  • idOtherSlave – id collection of the new slave that has to be linked to an existing master

add_collection(self, theCollection, kwargs=None)[source]
add_graph(self, howToPlotGraph)[source]
createGraphs(self)[source]
static get_x_y_to_plot(theCollection, howToPlotGraph)[source]
get_howToPlotGraph(self, idGraph)[source]
get_collectionInfo(self, idCollectionInfo)[source]
create_trace(self, collectionInfo, howToPlotGraph, idGraph)[source]
get_all_id_graphs(self)[source]
get_all_traces_id_graph(self, idGraph)[source]
update_graphs(self)[source]
is_slave(self, idGraph, idTrace)[source]
get_idCollection_from_graph(self, idGraph, idTrace, getMaster=True)[source]

From indices in the graph, get index of corresponding collection

get_collection_from_graph(self, idGraph, idTrace, getMaster=True)[source]

From indices in the graph, get corresponding collection

get_dataObject_from_graph(self, idGraph, idTrace, idPoint)[source]
get_dataObjects_from_graph(self, idGraph, idTrace, idPoint_list)[source]
remove_element_from_graph(self, idGraph, idTrace, idPoint, deleteFromMaster=False)[source]

Remove element from the graph, or the master collection

remove_elements_from_trace(self, idGraph, idTrace, idPoints, deleteFromMaster=False)[source]

Performances optimisation when compared to LinkDataGraph.remove_element_from_graph()

Link data :param id_collection_graph: :param id_collection_master: :return:

remove_trace(self, idGraph, idTrace)[source]
get_graph_and_trace_from_collection(self, idCollection)[source]

Reverse search: from a collection, get the associated graph

get_mappingData_graph(self, idGraph)[source]
get_mappingData_trace(self, idGraph, idTrace)[source]
get_idcollection_from_collection(self, theCollection)[source]
get_idPoints_from_indices_in_collection(self, idGraph, idTrace, indices_in_collection)[source]
class HowToPlotGraph(attribute_x, attribute_y, kwargs_graph=None, excluded=None, exclusively=None, check_if_plot_elem=None)[source]
exclude_col(self, id_col)[source]

Add id_col to exclude from the graph

exclusive_col(self, id_col)[source]

Set id_col to have exclusivity on the graph

__str__(self)[source]
class Option_class[source]

Bases: optimeed.core.options.Option_class_interface

__str__(self)[source]
get_optionValue(self, optionId)[source]
set_optionValue(self, optionId, value)[source]
get_all_options(self)[source]
set_all_options(self, options)[source]
add_option(self, idOption, name, value)[source]
class gui_mainWindow(QtWidgetList, isLight=True, actionOnWindowClosed=None, neverCloseWindow=False, title_window='Awesome Visualisation Tool', size=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

Main class that spawns a Qt window. Use run() to display it.

set_actionOnClose(self, actionOnWindowClosed)[source]
closeEvent(self, event)[source]
run(self, hold=False)[source]

Display the window

static hold()[source]
keyPressEvent(self, event)[source]
class widget_graphs_visual(theGraphs, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget element to draw a graph. The traces and graphs to draw are defined in Graphs taken as argument. This widget is linked to the excellent third-party library pyqtgraph, under MIT license

signal_must_update
signal_graph_changed
set_graph_disposition(self, indexGraph, row=1, col=1, rowspan=1, colspan=1)[source]

Change the graphs disposition.

Parameters
  • indexGraph – index of the graph to change

  • row – row where to place the graph

  • col – column where to place the graph

  • rowspan – number of rows across which the graph spans

  • colspan – number of columns across which the graph spans

Returns

__create_graph(self, idGraph)
__check_graphs(self)
on_click(self, plotDataItem, clicked_points)[source]
update_graphs(self, singleUpdate=True)[source]

This method is used to update the graph. This is fast but NOT safe (especially when working with threads). To limit the risks, please use self.signal_must_update.emit() instead.

Parameters

singleUpdate – if set to False, the graph will periodically refres each self.refreshtime

fast_update(self)[source]

Use this method to update the graph in a fast way. NOT THREAD SAFE.

exportGraphs(self)[source]

Export the graphs

export_txt(self, filename_txt)[source]
export_svg(self, filename)[source]
static export_pdf(filename_svg, filename_pdf)[source]
static export_png(filename_svg, filename_png)[source]
export_tikz(self, foldername_tikz)[source]
link_axes(self)[source]
get_graph(self, idGraph)[source]

Get corresponding GraphVisual of the graph idGraph

keyPressEvent(self, event)[source]

What happens if a key is pressed. R: reset the axes to their default value

delete_graph(self, idGraph)[source]

Delete the graph idGraph

delete(self)[source]
get_all_graphsVisual(self)[source]

Return a dictionary {idGraph: GraphVisual}.

get_layout_buttons(self)[source]

Get the QGraphicsLayout where it’s possible to add buttons, etc.

set_actionOnClick(self, theActionOnClick)[source]

Action to perform when the graph is clicked

Parameters

theActionOnClickon_graph_click_interface

Returns

set_title(self, idGraph, titleName, **kwargs)[source]

Set title of the graph

Parameters
  • idGraph – id of the graph

  • titleName – title to set

set_article_template(self, graph_size_x=8.8, graph_size_y=4.4, legendPosition='NW')[source]

Method to set the graphs to article quality graph.

Parameters
  • graph_size_x – width of the graph in cm

  • graph_size_y – height of the graph in cm

  • legendPosition – position of the legend (NE, SE, SW, NW)

Returns

class on_graph_click_showInfo(theLinkDataGraph, visuals=None)[source]

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On click: show informations about the points (loop through attributes)

class DataInformationVisuals[source]
delete_visual(self, theVisual)[source]
add_visual(self, theVisual, theTrace, indexPoint)[source]
get_new_index(self)[source]
curr_index(self)[source]
graph_clicked(self, theGraphVisual, index_graph, index_trace, indices_points)[source]

Action to perform when a point in the graph has been clicked: Creates new window displaying the device and its informations

get_name(self)[source]
class guiPyqtgraph(graphsVisual, **kwargs)[source]

Create a gui for pyqtgraph with trace selection options, export and action on clic choices

refreshTraceList(self)[source]

Refresh all the traces

check_if_must_plot(elem)[source]
class OptimizationDisplayer(thePipeOpti, listOfObjectives, theOptimizer, additionalWidgets=None)[source]

Bases: optimeed.core.Option_class

Class used to display optimization process in real time

signal_optimization_over
SHOW_CONSTRAINTS = 0
set_actionsOnClick(self, theList)[source]

Set actions to perform on click, list of on_graph_click_interface

generate_optimizationGraphs(self)[source]

Generates the optimization graphs. :return: Graphs, LinkDataGraph, :class:’~optimeed.visulaize.gui.widgets.widget_graphs_visual.widget_graphs_visual

__change_appearance_violate_constraints(self)
__refresh(self)
start_autorefresh(self, timer_autosave)[source]
stop_autorefresh(self)[source]
__set_graphs_disposition(self)

Set nicely the graphs disposition

launch_optimization(self, refresh_time=0.1)[source]

Perform the optimization and spawn the convergence graphs afterwards.

__callback_optimization(self)
close_windows(self)[source]
static display_graphs(theGraphs)[source]
create_main_window(self)[source]

From the widgets and the actions on click, spawn a window and put a gui around widgetsGraphsVisual.

class widget_graphs_visual(theGraphs, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget element to draw a graph. The traces and graphs to draw are defined in Graphs taken as argument. This widget is linked to the excellent third-party library pyqtgraph, under MIT license

signal_must_update
signal_graph_changed
set_graph_disposition(self, indexGraph, row=1, col=1, rowspan=1, colspan=1)[source]

Change the graphs disposition.

Parameters
  • indexGraph – index of the graph to change

  • row – row where to place the graph

  • col – column where to place the graph

  • rowspan – number of rows across which the graph spans

  • colspan – number of columns across which the graph spans

Returns

__create_graph(self, idGraph)
__check_graphs(self)
on_click(self, plotDataItem, clicked_points)[source]
update_graphs(self, singleUpdate=True)[source]

This method is used to update the graph. This is fast but NOT safe (especially when working with threads). To limit the risks, please use self.signal_must_update.emit() instead.

Parameters

singleUpdate – if set to False, the graph will periodically refres each self.refreshtime

fast_update(self)[source]

Use this method to update the graph in a fast way. NOT THREAD SAFE.

exportGraphs(self)[source]

Export the graphs

export_txt(self, filename_txt)[source]
export_svg(self, filename)[source]
static export_pdf(filename_svg, filename_pdf)[source]
static export_png(filename_svg, filename_png)[source]
export_tikz(self, foldername_tikz)[source]
link_axes(self)[source]
get_graph(self, idGraph)[source]

Get corresponding GraphVisual of the graph idGraph

keyPressEvent(self, event)[source]

What happens if a key is pressed. R: reset the axes to their default value

delete_graph(self, idGraph)[source]

Delete the graph idGraph

delete(self)[source]
get_all_graphsVisual(self)[source]

Return a dictionary {idGraph: GraphVisual}.

get_layout_buttons(self)[source]

Get the QGraphicsLayout where it’s possible to add buttons, etc.

set_actionOnClick(self, theActionOnClick)[source]

Action to perform when the graph is clicked

Parameters

theActionOnClickon_graph_click_interface

Returns

set_title(self, idGraph, titleName, **kwargs)[source]

Set title of the graph

Parameters
  • idGraph – id of the graph

  • titleName – title to set

set_article_template(self, graph_size_x=8.8, graph_size_y=4.4, legendPosition='NW')[source]

Method to set the graphs to article quality graph.

Parameters
  • graph_size_x – width of the graph in cm

  • graph_size_y – height of the graph in cm

  • legendPosition – position of the legend (NE, SE, SW, NW)

Returns

class gui_mainWindow(QtWidgetList, isLight=True, actionOnWindowClosed=None, neverCloseWindow=False, title_window='Awesome Visualisation Tool', size=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

Main class that spawns a Qt window. Use run() to display it.

set_actionOnClose(self, actionOnWindowClosed)[source]
closeEvent(self, event)[source]
run(self, hold=False)[source]

Display the window

static hold()[source]
keyPressEvent(self, event)[source]
start_qt_mainloop()[source]

Starts qt mainloop, which is necessary for qt to handle events

stop_qt_mainloop()[source]

Stops qt mainloop and resumes to program

class Data(x: list, y: list, x_label='', y_label='', legend='', is_scattered=False, transfo_x=lambda selfData, x: x, transfo_y=lambda selfData, y: y, xlim=None, ylim=None, permutations=None, sort_output=False, color=None, symbol='o', symbolsize=8, fillsymbol=True, outlinesymbol=1.8, linestyle='-', width=2)[source]

This class is used to store informations necessary to plot a 2D graph. It has to be combined with a gui to be useful (ex. pyqtgraph)

set_data(self, x: list, y: list)[source]

Overwrites current datapoints with new set

get_x(self)[source]

Get x coordinates of datapoints

get_symbolsize(self)[source]

Get size of the symbols

symbol_isfilled(self)[source]

Check if symbols has to be filled or not

get_symbolOutline(self)[source]

Get color factor of outline of symbols

get_length_data(self)[source]

Get number of points

get_xlim(self)[source]

Get x limits of viewbox

get_ylim(self)[source]

Get y limits of viewbox

get_y(self)[source]

Get y coordinates of datapoints

get_color(self)[source]

Get color of the line

get_width(self)[source]

Get width of the line

get_number_of_points(self)[source]

Get number of points

get_plot_data(self)[source]

Call this method to get the x and y coordinates of the points that have to be displayed. => After transformation, and after permutations.

Returns

x (list), y (list)

get_permutations(self, x=None)[source]

Return the transformation ‘permutation’: xplot[i] = xdata[permutation[i]]

get_invert_permutations(self)[source]

Return the inverse of permutations: xdata[i] = xplot[revert[i]]

get_dataIndex_from_graphIndex(self, index_graph_point)[source]

From an index given in graph, recovers the index of the data.

Parameters

index_graph_point – Index in the graph

Returns

index of the data

get_dataIndices_from_graphIndices(self, index_graph_point_list)[source]

Same as get_dataIndex_from_graphIndex but with a list in entry. Can (?) improve performances for huge dataset.

Parameters

index_graph_point_list – List of Index in the graph

Returns

List of index of the data

get_graphIndex_from_dataIndex(self, index_data)[source]

From an index given in the data, recovers the index of the graph.

Parameters

index_data – Index in the data

Returns

index of the graph

get_graphIndices_from_dataIndices(self, index_data_list)[source]

Same as get_graphIndex_from_dataIndex but with a list in entry. Can (?) improve performances for huge dataset.

Parameters

index_data_list – List of Index in the data

Returns

List of index of the graph

set_permutations(self, permutations)[source]

Set permutations between datapoints of the trace

Parameters

permutations – list of indices to plot (example: [0, 2, 1] means that the first point will be plotted, then the third, then the second one)

get_x_label(self)[source]

Get x label of the trace

get_y_label(self)[source]

Get y label of the trace

get_legend(self)[source]

Get name of the trace

get_symbol(self)[source]

Get symbol

add_point(self, x, y)[source]

Add point(s) to trace (inputs can be list or numeral)

delete_point(self, index_point)[source]

Delete a point from the datapoints

is_scattered(self)[source]

Delete a point from the datapoints

set_indices_points_to_plot(self, indices)[source]

Set indices points to plot

get_indices_points_to_plot(self)[source]

Get indices points to plot

get_linestyle(self)[source]

Get linestyle

__str__(self)[source]
export_str(self)[source]

Method to save the points constituting the trace

set_color(self, theColor)[source]
class Graphs[source]

Contains several Graph

updateChildren(self)[source]
add_trace_firstGraph(self, data, updateChildren=True)[source]

Same as add_trace, but only if graphs has only one id :param data: :param updateChildren: :return:

add_trace(self, idGraph, data, updateChildren=True)[source]

Add a trace to the graph

Parameters
  • idGraph – id of the graph

  • dataData

  • updateChildren – Automatically calls callback functions

Returns

id of the created trace

remove_trace(self, idGraph, idTrace, updateChildren=True)[source]

Remove the trace from the graph

Parameters
  • idGraph – id of the graph

  • idTrace – id of the trace to remove

  • updateChildren – Automatically calls callback functions

get_first_graph(self)[source]

Get id of the first graph

Returns

id of the first graph

get_graph(self, idGraph)[source]

Get graph object at idgraph

Parameters

idGraph – id of the graph to get

Returns

Graph

get_all_graphs_ids(self)[source]

Get all ids of the graphs

Returns

list of id graphs

get_all_graphs(self)[source]

Get all graphs. Return dict {id: Graph}

add_graph(self, updateChildren=True)[source]

Add a new graph

Returns

id of the created graph

remove_graph(self, idGraph)[source]

Delete a graph

Parameters

idGraph – id of the graph to delete

add_update_method(self, childObject)[source]

Add a callback each time a graph is modified.

Parameters

childObject – method without arguments

export_str(self)[source]

Export all the graphs in text

Returns

str

merge(self, otherGraphs)[source]
reset(self)[source]
is_empty(self)[source]
class guiPyqtgraph(graphsVisual, **kwargs)[source]

Create a gui for pyqtgraph with trace selection options, export and action on clic choices

refreshTraceList(self)[source]

Refresh all the traces

class PlotHolders[source]
add_plot(self, x, y, **kwargs)[source]
get_wgGraphs(self)[source]
new_plot(self)[source]
set_title(self, theTitle, **kwargs)[source]
reset(self)[source]
axis_equal(self)[source]
class WindowHolders[source]
set_currFigure(self, currFigure)[source]
add_plot(self, *args, **kwargs)[source]
set_title(self, *args, **kwargs)[source]
new_figure(self)[source]
new_plot(self)[source]
show(self)[source]
get_curr_plotHolder(self)[source]
get_wgGraphs(self, fig=None)[source]
get_all_figures(self)[source]
axis_equal(self)[source]
myWindows[source]
plot(x, y, hold=False, **kwargs)[source]

Plot new trace

show()[source]

Show (start qt mainloop) graphs. Blocking

figure(numb)[source]

Set current figure

new_plot()[source]

Add new plot

set_title(theTitle, **kwargs)[source]

Set title of the plot

axis_equal()[source]
get_all_figures()[source]

Get all existing figures

get_wgGraphs(fig=None)[source]

Advanced option. :return: widget_graphs_visual