super_hydro.clients.notebook

Jupyter Notebook interface.

For performance here, we use IPyWidgets and our custom Canvas widget. This allows reasonable frame-rates, an order of magnitude faster than using matplotlib.imshow for example.

By stacking various elements, we can allow the user to update components of the simulation.

Control is driven by alternating between python and javascript. We register the update function which the Canvas will then call after the browser is finished displaying the last frame.

Functions

contextmanager(func)

@contextmanager decorator.

get_app([run_server, network_server, notebook])

log(msg[, level])

Log msg to the logger.

log_task(msg[, level])

Context for tasks with paired start and Done messages.

nointerrupt(f)

Decorator that suspends signals and passes an interrupted flag to the protected function.

run([run_server, network_server])

Start the notebook client.

Classes

App(opts[, width])

DensityMixin()

Basic client mixin with functions for manipulating density array.

NoInterrupt([ignore])

Suspend the various signals during the execution block and a simple mechanism to allow threads to be interrupted.

NotebookApp(opts[, width])