Benchmarking code that raises
I am trying to use
benchmark
to time numpy code. However, numpy raises and it appears that benchmark.run
cannot handle a function that raises. I am not a python programmer, so I am not familiar with the exception syntax. Is there a way to wrap numpy code such that the surrounding function does not raise?2 Replies
Yeah you can wrap it in
try/except
:
I tried that and it did not work. I'll give it another go.