idmtools.entities.iplatform_ops.utils module

idmtools.entities.iplatform_ops.utils.batch_items(items: Union[Iterable, Generator], batch_size=16)

Batch items

Parameters
  • items

  • batch_size

Returns:

idmtools.entities.iplatform_ops.utils.item_batch_worker_thread(create_func: Callable, items: List) → List

Default batch worker thread function. It just calls create on each item

Parameters
  • create_func – Create function for item

  • items – Items to create

Returns

List of items created

idmtools.entities.iplatform_ops.utils.batch_create_items(items: Union[Iterable, Generator], batch_worker_thread_func: Callable[[List], List] = None, create_func: Callable[[], Any] = None, display_progress: bool = True, progress_description: str = 'Commissioning items', **kwargs)

Batch create items. You must specify either batch_worker_thread_func or create_func

Parameters
  • items – Items to create

  • batch_worker_thread_func – Optional Function to execute. Should take a list and return a list

  • create_func – Optional Create function

  • display_progress – Enable progress bar

  • progress_description – Description to show in progress bar

  • **kwargs

Returns:

idmtools.entities.iplatform_ops.utils.show_progress_of_batch(pbar: tqdm.std.tqdm, futures: List[concurrent.futures._base.Future], progress_description: str, total: int) → List

Show progress bar for batch

Parameters
  • pbar – Progress bar

  • futures – List of futures that are still running/queued

  • progress_description – Progress description

  • total – Total items being loaded(since we are loading in batches)

Returns: