spinn_machine.utilities package

Submodules

spinn_machine.utilities.ordered_set module

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

Bases: collections.abc.MutableSet

add(key)[source]

Add an element.

discard(key)[source]

Remove an element. Do not raise an exception if absent.

pop(last=True)[source]

Return the popped value. Raise KeyError if empty.

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)[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
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