idmtools.utils.collections module

idmtools.utils.collections.cut_iterable_to(obj: Iterable, to: int) → Tuple[Union[List, Mapping], int]

Cut an iterable to a certain length.

Parameters
  • obj – The iterable to cut.

  • to – The number of elements to return.

Returns

A list or dictionary (depending on the type of object) of elements and the remaining elements in the original list or dictionary.

class idmtools.utils.collections.ExperimentParentIterator(*args, **kwds)

Bases: collections.abc.Iterator, typing.Generic

append(item: Simulation)

Adds a simulation to an object

Parameters

item – Item to add

Returns

None

extend(item: Union[List[Simulation], TemplatedSimulations])

Extends object(adds :param item:

Returns

None

class idmtools.utils.collections.ResetGenerator(*args, **kwds)

Bases: collections.abc.Iterator, typing.Generic

Iterator that counts upward forever.

next_gen()
idmtools.utils.collections.duplicate_list_of_generators(lst: List[Generator])

Copy a list of iterators using tee :param lst: List of generators

Returns

Tuple with duplicate of iterators