posydon.visualization.VH_diagram
posydon.visualization.VH_diagram.GraphVisualizer
Graph Visualizer for the VH diagram.
- class posydon.visualization.VH_diagram.GraphVisualizer.CaseInfos(column_id, *, centered_txt: str = '', bot_right_txt: str = '', bot_left_txt: str = '', top_right_txt: str = '', tot_left_txt: str = '', border_width: int = 0)[source]
Bases:
Infos
Informations to create a case widget.
Initialize a CaseInfos instance.
- class posydon.visualization.VH_diagram.GraphVisualizer.ConnectedItem(from_item: GraphVisualizerItem, to_item: GraphVisualizerItem)[source]
Bases:
object
Represent a visual link between 2 widgets.
Initialize a ConnectedItem instance.
- from_item: GraphVisualizerItem
- to_item: GraphVisualizerItem
- class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizer[source]
Bases:
QWidget
Widget used to display the different columns and add widget in them.
Initialize a GraphVisualizer instance.
- add_column(column_type, column_span=1)[source]
Create a column according to the column_type.
It takes account for the column_span of the logical column.
- Parameters:
column_type (columnTYPE) – Type of the column to add.
column_span (int) – Nb of logical column used.
- Returns:
ID of created column.
- Return type:
- add_line(infos)[source]
Add all lines based on all elements in infos.
For each info in infos, create the corresponding widget and add it to the column with corresponding id (given in each info), only 1 widget per column by call, if one column haven’t any widget associated, column skip this row.
- Parameters:
infos (Array of Infos) – Array with derivated struct of Infos to create the different widget for this line.
- class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerCase[source]
Bases:
GraphVisualizerItem
Case widget in GraphVisualizer.
Provides the ability to display 5 texts: 2 on the top 2 on the bottom, and 1 in center. Can have a border.
Initialize a GraphVisualizerCase instance.
- class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerConnectedcolumn(grid, column_id, column_span=1)[source]
Bases:
GraphVisualizercolumn
Simple visual column with arrow between connected widget.
Initialize a GraphVisualizerConnectedcolumn instance.
- class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerItem[source]
Bases:
QWidget
Define the mother-class for widget in GraphVisualizer.
- connected
Indicate if this widget need to be connected with the previous one in the same column.
- Type:
Initialize a GraphVisualizerItem instrance.
- class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerPoint[source]
Bases:
GraphVisualizerItem
Widget containing GraphVisualizerPointDraw.
Provides the ability to display 2 texts, one at each side.
Initialize a GraphVisualizerPoint instance.
- class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerPointDraw[source]
Bases:
QWidget
Define an empty widget with a point drew.
Initialize a GraphVisualizerPointDraw instance.
- class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerState[source]
Bases:
GraphVisualizerItem
Widget containing drawings.
Provides the ability to display 4 texts on top & bottom.
Initialize a GraphVisualizerState instance.
- class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerTimeline(grid, column_id, column_span=1)[source]
Bases:
GraphVisualizercolumn
Draw a visual column, compressed by another other column.
Initialize a GraphVisualizerTimeline instance.
- class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizercolumn(grid, column_id, column_span)[source]
Bases:
object
Mother-class of visual column in GraphVisualizer.
Manage one visual column in the QGridLayout (can take several logical columns).
Initialize a GraphVisualizercolumn instance.
- Parameters:
- add_item(item)[source]
Add one item in the column, connect it to previous if needed.
- Parameters:
item (GraphVisualizerItem) – Widget to add in column.
- class posydon.visualization.VH_diagram.GraphVisualizer.INFOSTYPE(value)[source]
Bases:
Enum
Enumeration of different type of infos.
- CASE = 1
- POINT = 2
- STATE = 3
- class posydon.visualization.VH_diagram.GraphVisualizer.Infos(column_id, infos_type, connected)[source]
Bases:
object
Mother-class with common informations uselful for all widget.
Initialize an Infos instance.
- class posydon.visualization.VH_diagram.GraphVisualizer.PointInfos(column_id, text: str = '')[source]
Bases:
Infos
Informations to create a widget with a point drew.
Initialize a PointInfos instance.
- class posydon.visualization.VH_diagram.GraphVisualizer.StateInfos(column_id, *, S1_filename=None, S2_filename=None, event_filename=None, distance=1)[source]
Bases:
Infos
Information to create a widget with a line of diagram inside.
Initialize a StateInfos instance.
- class posydon.visualization.VH_diagram.GraphVisualizer.columnTYPE(value)[source]
Bases:
Enum
Enumeration of different column type.
- CONNECTED = 2
- TIMELINE = 1
- posydon.visualization.VH_diagram.GraphVisualizer.prepare_case(infos: CaseInfos)[source]
Help to create GraphVisualizerCase from CaseInfos.
- Parameters:
infos (CaseInfos) – Infos to create the widget.
- Returns:
Created widget with given infos.
- Return type:
- posydon.visualization.VH_diagram.GraphVisualizer.prepare_point(infos: PointInfos)[source]
Help to create GraphVisualizerPoint from PointInfos.
- Parameters:
infos (PointInfos) – Infos to create the widget.
- Returns:
Created widget with given infos.
- Return type:
- posydon.visualization.VH_diagram.GraphVisualizer.prepare_state(infos: StateInfos)[source]
Help to create GraphVisualizerState from StateInfos.
- Parameters:
infos (StateInfos) – Infos to create the widget.
- Returns:
Created widget with given infos.
- Return type:
posydon.visualization.VH_diagram.MainWindow
Main Window handler for VH diagram.
- class posydon.visualization.VH_diagram.MainWindow.MainWindow[source]
Bases:
QMainWindow
Custom window to display the application.
Initialize a MainWindow instance.
- save_requiered
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- class posydon.visualization.VH_diagram.MainWindow.VisualizerInterface(main_win, visualizer, options)[source]
Bases:
object
Handle for all callback triggered by user.
Initialize a VisualizerInterface instance.
- Parameters:
main_win (MainWindow) – The main window used.
visualizer (GraphVisualizer) – Custom widget to display graph.
options (OptionsWindow) – Window used to display options.
posydon.visualization.VH_diagram.MathTextLabel
Provide LaTeX-interpreted labels in the VH diagram.
posydon.visualization.VH_diagram.OptionsWindow
Options Window handler for the VH diagram.
- class posydon.visualization.VH_diagram.OptionsWindow.OptionsWindow[source]
Bases:
QWidget
Window to display available options, emit signal for selected option.
Initialize a OptionsWindow instance.
- detail_requiered
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- diagram_required
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- distance_representation_required
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- reduce_required
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- set_showed_mode(mode: PresenterMode)[source]
Set the showed mode.
- simplify_required
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
posydon.visualization.VH_diagram.ParseDataFrame
Counting distincts occurence of binary simulation from a file
posydon.visualization.VH_diagram.Presenter
Data visualization in VH diagram.
- class posydon.visualization.VH_diagram.Presenter.Presenter(filename, path='./')[source]
Bases:
object
Charged to setup window and format data before calling display funcs.
Initialize a Presenter instance.
- PATH_TO_DRAWS = '/home/runner/work/POSYDON/POSYDON/POSYDON/posydon/visualization/VH_diagram/draws'
- PATH_TO_SCREENS = '/home/runner/work/POSYDON/POSYDON/POSYDON/docs/screens'
- class posydon.visualization.VH_diagram.Presenter.SimplifiedInfo(state_before=None, state_after=None)[source]
Bases:
object
Simple class to store an before/after info and simplfy dataframe.
- Parameters:
state_before (any value) – Value for the older state.
state_after (any value) – Value for the younger state.
- state_before
- state_after
Initialize a SimplifiedInfo instance.
- posydon.visualization.VH_diagram.Presenter.calculate_separation(data)[source]
For each row in dataframe, calculate the separation.
- Parameters:
data (pandas.DataFrame) – Complete dataframe without ‘separation’.
- Returns:
Array of calculated separations, len(array) == nb rows.
- Return type:
Array of float
- posydon.visualization.VH_diagram.Presenter.combine_simplified_data(*, data_to, data_from)[source]
Combine 2 dictionaries of SimplifiedInfo.
data_to[].state_after take the value of data_from[].state_before.
- Parameters:
data_to (dictionary of SimplifiedInfo) – Informations who will be udpated.
data_from (dictionary of SimplifiedInfo) – Informations who will be combined.
- posydon.visualization.VH_diagram.Presenter.equal_with_epsilon(nb_1, nb_2, epsilon)[source]
Check if 2 numbers are equal up to epsilon.
- posydon.visualization.VH_diagram.Presenter.get_event_state_filename(left_star_state, event_state, right_star_state, *, suffix='')[source]
Get the name of the file illustrating the event with the 2 given star.
- posydon.visualization.VH_diagram.Presenter.get_max_distance(data)[source]
Get max distance from a dictionary of SimplifiedInfo.
- Parameters:
data (dictionnary of SimplifiedInfo) – Dictionnary, full of SimplifiedInfo, containing all infos
- Returns:
Max distance of this row, accroding to before/after state
- Return type:
- posydon.visualization.VH_diagram.Presenter.get_star_state_filename(state, *, suffix='')[source]
Get the name of the file illustring the state of one star.
- posydon.visualization.VH_diagram.Presenter.to_simplified_data(row)[source]
Convert dictionnary of SimplifiedInfo with values as .state_before.
- Parameters:
row (dictionnary) – Dictionnary of value to convert.
- Returns:
Dictionnary of SimplifiedInfo containing the value as SimplifiedInfo.state_before.
- Return type:
dictionnary of SimplifiedInfo
posydon.visualization.VH_diagram.PresenterMode
The definition of the PresenterMode class in VH diagram.
posydon.visualization.VH_diagram.PresenterMultiple
- class posydon.visualization.VH_diagram.PresenterMultiple.Presenter_h(filename, path='./', frequency=None)[source]
Bases:
Presenter
Handles drawing binaries as hierarchical trees
Initialize a Presenter instance.
- class posydon.visualization.VH_diagram.PresenterMultiple.Presenter_m(filename, path='./', frequency=None)[source]
Bases:
Presenter
Handle multiple Diagram view
Initialize a Presenter instance.
- class posydon.visualization.VH_diagram.PresenterMultiple.VHdiagramm_m(filename, path='./', index=[0], *, frequency=None, hierarchy=False, presentMode=PresenterMode.DIAGRAM, displayMode=DisplayMode.WINDOW, figsize=(10, 8))[source]
Bases:
object
Handle a multiple or hierarchical VH diagram plot.
Initialize a VHdiagram_m instance.
posydon.visualization.VH_diagram.SimulationModel
The definition of the SimulationModel class.
- class posydon.visualization.VH_diagram.SimulationModel.SimulationModel(filename, path='./')[source]
Bases:
object
Model containing the dataset of simulations.
Initialize a SimulationModel instance.