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', unit: str = None, **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
unit – Unit for progress bar
**kwargs –
Returns:
-
idmtools.entities.iplatform_ops.utils.
show_progress_of_batch
(progress_bar: tqdm, futures: List[concurrent.futures._base.Future]) → List¶ Show progress bar for batch
- Parameters
progress_bar – Progress bar
futures – List of futures that are still running/queued
Returns: