7.5.2.1. pymodaq_gui.h5modules.browsing module

Created the 15/11/2022

@author: Sebastien Weber

class pymodaq_gui.h5modules.browsing.H5Browser(parent: QMainWindow, h5file=None, h5file_path=None, backend='tables')[source]

Bases: QObject, ActionManager

UI used to explore h5 files, plot and export subdatas

Parameters:
  • parent (QtWidgets container) – either a QWidget or a QMainWindow

  • h5file (h5file instance) – exact type depends on the backend

  • h5file_path (str or Path) – if specified load the corresponding file, otherwise open a select file dialog

  • backend (str) – either ‘tables, ‘h5py’ or ‘h5pyd’

See also

H5Backend, H5Backend

Methods

add_comments(status[, comment])

Add comments to a node

check_version()

Check version of PyMoDAQ to assert if file is compatible or not with the current version of the Browser

export_data()

Opens a dialog to export data

get_tree_node_path()

Get the node path of the currently selected node in the UI

populate_tree()

Init the ui-tree and store data into calling the h5_tree_to_Qtree convertor method

setup_actions()

Method where to create actions to be subclassed.

show_h5_data(item[, with_bkg, plot_all])

param item:

add_log

connect_things

data_node_signal

get_node_and_plot

load_file

quit_fun

save_file

setup_menu

show_about

show_h5_attributes

show_help

show_log

show_pixmaps

status_signal

add_comments(status: bool, comment='')[source]

Add comments to a node

Parameters:
  • status (bool) –

  • comment (str) – The comment to be added in a comment attribute to the current node path

See also

current_node_path

static add_log(txt)[source]
check_version()[source]

Check version of PyMoDAQ to assert if file is compatible or not with the current version of the Browser

connect_things()[source]
export_data()[source]

Opens a dialog to export data

get_node_and_plot(with_bkg, plot_all=False)[source]
get_tree_node_path()[source]

Get the node path of the currently selected node in the UI

load_file(h5file=None, h5file_path=None)[source]
populate_tree()[source]
Init the ui-tree and store data into calling the h5_tree_to_Qtree convertor method

See also

h5tree_to_QTree, update_status

quit_fun()[source]
save_file(filename=None)[source]
setup_actions()[source]

Method where to create actions to be subclassed. Mandatory

Examples

>>> self.add_action('Quit', 'close2', "Quit program")
>>> self.add_action('Grab', 'camera', "Grab from camera", checkable=True)
>>> self.add_action('Load', 'Open', "Load target file (.h5, .png, .jpg) or data from camera", checkable=False)
>>> self.add_action('Save', 'SaveAs', "Save current data", checkable=False)

See also

ActionManager.add_action

setup_menu()[source]
show_about()[source]
show_h5_attributes(item=None)[source]
show_h5_data(item, with_bkg=False, plot_all=False)[source]
Parameters:
  • item

  • with_bkg

  • plot_all

static show_help()[source]
static show_log()[source]
show_pixmaps(pixmaps=[])[source]
data_node_signal

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

status_signal

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 pymodaq_gui.h5modules.browsing.View(widget: QWidget, settings_tree, settings_attributes_tree)[source]

Bases: QObject

Attributes:
pixmap_widget
text_list
viewer_widget

Methods

add_actions

add_base_item

add_widget_to_tree

clear

current_node_path

item_clicked_sig

item_double_clicked_sig

setup_ui

add_actions(actions: List[QAction])[source]
add_base_item(base_tree_item)[source]
add_widget_to_tree(pixmap_items)[source]
clear()[source]
current_node_path()[source]
setup_ui(settings_tree, settings_attributes_tree)[source]
item_clicked_sig

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

item_double_clicked_sig

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

property pixmap_widget
property text_list
property viewer_widget
pymodaq_gui.h5modules.browsing.browse_data(fname=None, ret_all=False, message=None) Tuple[DataWithAxes, str, str][source]

Browse data present in any h5 file using the H5Browser within a dialog window when the user has selected a given node, return its content

Parameters:
  • fname (str) –

  • ret_all (bool) –

  • message (str) –

Returns:

  • data (DataWithAxes)

  • if argument ret_all is True, returns also

  • fname (the file name)

  • node_path (hte path of the selected node within the H5 file tree)