Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipython magic mprun doesn't work for multiple parameters #295

Open
bsipocz opened this issue Oct 14, 2020 · 1 comment
Open

ipython magic mprun doesn't work for multiple parameters #295

bsipocz opened this issue Oct 14, 2020 · 1 comment

Comments

@bsipocz
Copy link

bsipocz commented Oct 14, 2020

I yet to pin down the issue here, but there seem to some problems with %mprun when trying to run it for a function with multiple parameters.

In [26]: %mprun -f compute_XD_results(500, 5, 500)                                                                      
UsageError: Could not find function 'compute_XD_results(500,'.
SyntaxError: unexpected EOF while parsing (<string>, line 1)

While it seems to do something, it doesn't return any results. %memit works as expected.

In [27]: %mprun -f compute_XD_results(500) 
@PaulHancock
Copy link

I believe that you need to do the following:
%mprun -f compute_XD_results compute_XD_results(500, 5, 500)
the -f flag tells mprun which function needs profiling (just the function name) separate from the actual invocation of the function (which requires arguments)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants