everest.batch

Batch.

class everest.batch.Batch(start, size, total_size)[source]

Bases: object

Helper class to manage batches in a sequence.

__init__(start, size, total_size)[source]
Parameters:
  • start (int) – start index for this batch.
  • size (int) – batch size.
  • total_size (int) – total size of the batched sequence.
__weakref__

list of weak references to the object (if defined)

first[source]

Returns the first batch for the batched sequence.

Return type:Batch instance.
index[source]

Returns the index of this batch in the batched sequence.

Return type:integer
last[source]

Returns the last batch for the batched sequence.

Return type:Batch instance.
next[source]

Returns the next batch for the batched sequence or None, if this batch is already the last batch.

Return type:Batch instance or None.
number[source]

Returns the number of batches the batched sequence contains.

Return type:integer.
previous[source]

Returns the previous batch for the batched sequence or None, if this batch is already the first batch.

Return type:Batch instance or None.

Project Versions

Previous topic

everest.views.utils

Next topic

everest.configuration

This Page