Skip to content

Add IPython syntax support to the %timeit magic, in line and cell mode #1923

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

Merged
merged 5 commits into from
Jun 12, 2012

Conversation

fperez
Copy link
Member

@fperez fperez commented Jun 12, 2012

Allows the %%timeit magic to understand IPython special syntax, so the following both work:

%timeit %lmagic a+3

and

%%timeit
%lmagic a+3

It became clear to me that this would make a huge difference in the polish of the experience when timing parallel codes using the %px magic.

@takluyver
Copy link
Member

I've had a look at the code and I don't see any problems. I've just kicked off a test run.

@takluyver
Copy link
Member

Test results for commit 919a026 merged into master
Platform: linux2

  • python2.7: OK (libraries not available: rpy2 tornado)
  • python3.1: OK (libraries not available: cython matplotlib numpy pymongo qt rpy2 wx wx.aui zmq)
  • python3.2: OK (libraries not available: cython pymongo rpy2 wx wx.aui)

Not available for testing: python2.6

@fperez
Copy link
Member Author

fperez commented Jun 12, 2012

Great, thanks! Merge OK then?

@takluyver
Copy link
Member

Go for it!

@fperez
Copy link
Member Author

fperez commented Jun 12, 2012

Merging!

fperez added a commit that referenced this pull request Jun 12, 2012
Add IPython syntax support to the %timeit magic, in line and cell mode.

Allows the `%%timeit` magic to understand IPython special syntax, so the following both work:

%timeit %lmagic a+3

and

%%timeit
%lmagic a+3


This improve the experience in situations such as  timing parallel codes using the `%px` magic.
@fperez fperez merged commit 2f5618c into ipython:master Jun 12, 2012
@fperez fperez mentioned this pull request Jun 15, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Add IPython syntax support to the %timeit magic, in line and cell mode.

Allows the `%%timeit` magic to understand IPython special syntax, so the following both work:

%timeit %lmagic a+3

and

%%timeit
%lmagic a+3


This improve the experience in situations such as  timing parallel codes using the `%px` magic.
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

Successfully merging this pull request may close these issues.

2 participants