spinn_machine.utilities package

Submodules

spinn_machine.utilities.ordered_set module

class spinn_machine.utilities.ordered_set.OrderedSet(iterable=None)[source]

Bases: _abcoll.MutableSet

add(key)[source]
discard(key)[source]
pop(last=True)[source]
update(iterable)[source]

spinn_machine.utilities.progress_bar module

class spinn_machine.utilities.progress_bar.ProgressBar(total_number_of_things_to_do, string_describing_what_being_progressed, step_character='=', end_character='|')[source]

Bases: object

Progress bar for telling the user where a task is up to

MAX_LENGTH_IN_CHARS = 60
end()[source]

Close the progress bar, updating whatever is left if needed

Return type:None
over(collection, finish_at_end=True)[source]

Simple wrapper for the cases where the progress bar is being used to show progress through the iteration over a single collection. The progress bar should have been initialised to the size of the collection being iterated over.

Parameters:
  • collection – The base collection (any iterable) being iterated over
  • finish_at_end – flag to say if the bar should finish at the end of the collection
Returns:

An iterable. Expected to be directly used in a for.

update(amount_to_add=1)[source]

Update the progress bar by a given amount

Parameters:amount_to_add
Return type:None

Module contents