I'm wondering how to do %lprun on a python script in a class stucture.
Say I want to see what's taking so long in run():
example.py
def outside_call():
mc = MLIC()
mc.run()
class MLIC(object):
def __init__():
pass
def run():
#Profile this function
Normally if run() wasn't in a class, I would use:
%lprun -f example.run example.run()
Now I need like...
%lprun -f example.MLIC.run() example.outside_call()
How do I accomplish this?
I'm an idiot.
In this case, you can actually do:
%lprun -f example.MLIC.run() example.outside_call()
I thought I tried it but typed it wrong.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With