Get items¶
Some functionalities are preimplemented to access the items and stuff
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
Get the HDF5 group of the selected item
Parameters: item (HDF5TreeItem) – treeview item Returns: the corresponding group Return type: HDF5 group
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
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
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
Send a dictionany to the QT console
Parameters: - item (HDF5TreeItem) – treeview item
- treeview (HDF5TreeWidget) – the treeview
Print the attribute in the console
Parameters: - item (HDF5TreeItem) – treeview item
- treeview (HDF5TreeWidget) – the treeview
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