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 Mock category groups all the simulated instruments under one banner: the ones whose name contains mock or starts with BS (beam steering demonstrations) are leaves of it, the Cookbook recipes and the Fake ones (name containing fake) 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 Mock category are names or single-key dicts {'Cookbook': [names]} (a submenu), as understood by pymodaq_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)

path is the tuple of the banners above name, for instance ('Mock', 'Cookbook').

Return type:

list