Skip to content

Instantly share code, notes, and snippets.

@mstimberg
Created May 17, 2016 11:55
Show Gist options
  • Save mstimberg/7164945c8db0c187e7a227927b21d775 to your computer and use it in GitHub Desktop.
Save mstimberg/7164945c8db0c187e7a227927b21d775 to your computer and use it in GitHub Desktop.
Print out the
def print_schedule(network=None):
if network is None:
network = magic_network
network._update_magic_objects(level=1)
network._sort_objects()
print('Available slots (also "before_..." and "after_..."):\n%s\n' % network.schedule)
print('Slot Order Name')
prev_slot = None
for obj in network.objects:
if isinstance(obj, (Synapses, NeuronGroup)):
continue
if obj.when != prev_slot:
prev_slot = obj.when
print('-----------------------------------------------------------------')
print('{obj.when:<20}{obj.order:<20}{obj.name}'.format(obj=obj))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment