diplomat.utils.shapes.shape_iterator

class diplomat.utils.shapes.shape_iterator(sequence: Iterable[str] | None = None, rep_count: int = None)[source]

Bases: object

Allows one to iterate over a list of shape strings indefinitely, and in groups. Used to iterate over shapes on a per individual basis.

__init__(sequence: Iterable[str] | None = None, rep_count: int = None)[source]

Get a new shape iterator.

Parameters:
  • sequence – The sequence of shapes to iterate over. If this is None, uses the default shape list.

  • rep_count – The number of values to iterate through before restarting at the beginning of the sequence. If larger than the sequence length, the iteration will wrap around the sequence, and continue until this value is reached and then reset.

Methods

__init__([sequence, rep_count])

Get a new shape iterator.