Yielded Batches

class YieldedBatches(key_maker)[source]

Bases: object

Keeps track of batches yielded by Selector.select().

Methods

get_num()

Get the number of times Selector.select() has yielded.

has_no_yielded_molecules(batch)

Check if batch consists only of unyielded molecules.

has_yielded_molecules(batch)

Check if batch contains any previously yielded molecules.

is_unyielded_batch(batch)

Check if batch has not been yielded.

is_yielded_batch(batch)

Check if batch has already been yielded.

update(batch)

Update tracked data with a new batch.

__init__(key_maker)[source]
get_num()[source]

Get the number of times Selector.select() has yielded.

Returns

The total number of times Selector.select() has yielded.

Return type

int

has_no_yielded_molecules(batch)[source]

Check if batch consists only of unyielded molecules.

Parameters

batch (Batch) – The batch to check.

Returns

True if batch does not have any previously yielded molecules.

Return type

bool

has_yielded_molecules(batch)[source]

Check if batch contains any previously yielded molecules.

Parameters

batch (Batch) – The batch to check.

Returns

True if batch contains any molecules which have previously been yielded.

Return type

bool

is_unyielded_batch(batch)[source]

Check if batch has not been yielded.

Parameters

batch (Batch) – The batch to check.

Returns

True if batch has not been yielded.

Return type

bool

is_yielded_batch(batch)[source]

Check if batch has already been yielded.

Parameters

batch (Batch) – The batch to check.

Returns

True if batch has already been yielded.

Return type

bool

update(batch)[source]

Update tracked data with a new batch.

Parameters

batch (Batch) – A batch yielded by Selector.select().

Returns

The data tracker.

Return type

YieldedBatches