pathsim.utils.debugging module

class pathsim.utils.debugging.Timer(verbose=True)[source]

Bases: object

context manager that times the execution time of the code inside of the context in ‘ms’ for debugging purposes

Parameters:

verbose (bool) – flag for verbose output

pathsim.utils.debugging.timer(func)[source]

Shows the execution time in milliseconds of the function object passed for debugging purposes

Parameters:

func (callable) – function to track execution time of

pathsim.utils.debugging.track_block_runtime(cls)[source]

Class decorator that adds runtime tracking to all public methods. Also adds method to get runtime estimates based on rolling average.

class pathsim.utils.debugging.Profiler(top_n=50, sort_by='cumulative')[source]

Bases: ContextDecorator

Context manager for easy code profiling

Parameters:
  • top_n (int) – track top n function calls

  • sort_by (str) – method to sort function cally by