8.5.6. pymodaq_utils.categorizing module
- pymodaq_utils.categorizing.add_category_layers(dimension_dict, remote_items=None, mock_items=None)[source]
Add category layers to a dimension dictionary. Uses categorize_items for each dimension.
- Parameters:
dimension_dict – {dimension: [items]}
Returns: {dimension: {category: [items]}}
- pymodaq_utils.categorizing.categorize_items(item_list, remote_items=None, mock_items=None)[source]
Core function: categorize any list of items into Remote/Mock/Plugin.
The
Mockcategory groups all the simulated instruments under one banner: the ones whose name containsmockor starts withBS(beam steering demonstrations) are leaves of it, theCookbookrecipes and theFakeones (name containingfake) are in a submenu of their own.- Parameters:
item_list – List of items to categorize
remote_items – Custom set of remote items (optional)
mock_items – Custom set of mock items (optional)
Returns: dict {category: [items]} with only non-empty categories. The items of the
Mockcategory are names or single-key dicts{'Cookbook': [names]}(a submenu), as understood bypymodaq_gui.utils.menu_utils.build_menu_from_iterable().
- pymodaq_utils.categorizing.find_last_index(list_children=None, name_prefix='', format_string='02.0f')[source]
- pymodaq_utils.categorizing.flatten_categories(categorized)[source]
Flatten the result of
categorize_items()to a list of(path, name)pathis the tuple of the banners abovename, for instance('Mock', 'Cookbook').- Return type: