Get items

Some functionalities are preimplemented to access the items and stuff

h5xplorer.menu_tools.get_current_item(self, treeview, single=False)[source]

Get the item(s) that was selected

Parameters:
  • treeview (HDF5TreeWidget) – the treeview
  • single (bool, optional) – if true only single item possible
Returns:

Description

Return type:

TYPE

h5xplorer.menu_tools.get_current_hdf5_group(self, item)[source]

Get the HDF5 group of the selected item

Parameters:item (HDF5TreeItem) – treeview item
Returns:the corresponding group
Return type:HDF5 group
h5xplorer.menu_tools.get_group_data(group)[source]

Get the dataset of the item

Parameters:group (HDF5 group) – group of the treeview item
Returns:return np.array if the group has a dataset or None otherwise
Return type:dataset or None
h5xplorer.menu_tools.get_actions(treeview, position, list_action)[source]

Generate a singlelevel context menu of action and return the selected one

Example:

>>> list_operations = ['Print attrs','-','Plot Hist', 'Plot Map']
>>> action,actions = get_actions(treeview,position,list_operations)
>>> if action == actions['Print attrs']:
        send_dict_to_console(self,item,treeview)
Parameters:
  • treeview (HDF5TreeWidget) – the treeview
  • position (TYPE) – Description
  • list_action (list) – List of string giving the action names
Returns:

dict of QTMenu actions actions: the selected action

Return type:

actions

h5xplorer.menu_tools.get_multilevel_actions(treeview, position, list_action, sub_list)[source]

Generate a multilevel context menu of action and return the selected one

Example:

>>> list_operations = ['Hit Rate','Av. Prec.']
>>> list_subop = [['Train','Valid','Test'],['Train','Valid','Test']]
>>> action,actions = get_multilevel_actions(treeview,position,list_operations,list_subop)
Parameters:
  • treeview (HDF5TreeWidget) – the treeview
  • position (TYPE) – Description
  • list_action (list) – List of string giving the action names
  • sub_list (list) – list of string giving the subactions
Returns:

dict of QTMenu actions actions: the selected action

Return type:

actions

h5xplorer.menu_tools.send_dict_to_console(self, item, treeview)[source]

Send a dictionany to the QT console

Parameters:
  • item (HDF5TreeItem) – treeview item
  • treeview (HDF5TreeWidget) – the treeview
h5xplorer.menu_tools.print_attributes(self, item, treeview)[source]

Print the attribute in the console

Parameters:
  • item (HDF5TreeItem) – treeview item
  • treeview (HDF5TreeWidget) – the treeview
h5xplorer.menu_tools.get_user_values(varnames, vartypes='float', windowtitle='Enter Values')[source]

Get the values of variables from the users

Parameters:
  • varnames (list) – list of strings of all the desired variables
  • windowtitle (str, optional) – Name of the window
Returns:

list of float of the desired variables

Return type:

list