8.5.3.1. pymodaq_gui.h5modules.browsing module

Created the 15/11/2022

@author: Sebastien Weber

class pymodaq_gui.h5modules.browsing.H5Browser(parent, h5file=None, h5file_path=None, backend='h5py', swmr=False)[source]

Bases: CustomApp

App used to explore h5 files, plot and export subdatas

Parameters:
  • parent (QMainWindow) – 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’

  • swmr (bool) – if True, open the file in SWMR reading mode (h5py backend only)

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

connect_things()

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()

refresh_file()

Refresh the file view to show newly written data.

setup_actions()

setup_docks_and_widgets()

setup_menus_and_toolbars(menubar)

show_h5_data(item[, with_bkg, plot_all])

add_log

data_node_signal

get_node_and_plot

load_file

quit_fun

save_file

show_h5_attributes

show_pixmaps

status_signal

static add_log(txt)[source]
add_comments(status, 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

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

See also

H5BrowserUtil.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, swmr=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]
refresh_file()[source]

Refresh the file view to show newly written data.

In SWMR reader mode the h5py datasets are refreshed in-place so that new data written by the SWMR writer becomes visible. In non-SWMR mode the file is closed and reopened to pick up external changes.

The tree is then repopulated and expanded.

save_file(filename=None)[source]
setup_actions()[source]
setup_docks_and_widgets()[source]
setup_menus_and_toolbars(menubar)[source]
show_h5_attributes(item=None)[source]
show_h5_data(item, with_bkg=False, plot_all=False)[source]
Parameters:
  • item

  • with_bkg

  • plot_all

show_pixmaps(pixmaps=[])[source]
class pymodaq_gui.h5modules.browsing.View(widget, 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)[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]
h5file_tree: TreeLayout
property pixmap_widget
property text_list
property viewer_widget
pymodaq_gui.h5modules.browsing.browse_data(fname=None, ret_all=False, message=None)[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:
Return type:

Tuple[DataWithAxes, str, 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)