Notebook examples - Python 2 and 3 compatible #2627

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
5 participants
Owner

takluyver commented Nov 28, 2012

Make the example notebooks Python 2 and 3 compatible, so that Python 3 users can get started easily too.

Along the way, I found a couple of other minor issues in the notebooks, and a problem with Image() objects when created with data=b'...'.

Closes #2622.

Owner

ellisonbg commented Nov 28, 2012

Thomas,

Can you make these changes against this PR here:

#2537

I have completely rewritten all of the example notebooks...we really need
to get that PR merged.

Cheers,

Brian

On Wed, Nov 28, 2012 at 8:38 AM, Thomas Kluyver notifications@github.comwrote:

Make the example notebooks Python 2 and 3 compatible, so that Python 3
users can get started easily too.

Along the way, I found a couple of other minor issues in the notebooks,
and a problem with Image() objects when created with data=b'...'.

Closes #2622 #2622.

You can merge this Pull Request by running:

git pull https://github.com/takluyver/ipython notebook-examples-py3

Or view, comment on, or merge it at:

#2627
Commit Summary

  • Simple changes to make example notebooks Python 2 and 3 compatible
  • Fixes to display objects in Python 3

File Changes

  • M IPython/core/display.py (6)
  • M IPython/utils/py3compat.py (4)
  • M docs/examples/notebooks/00_notebook_tour.ipynb (9)
  • M docs/examples/notebooks/01_notebook_introduction.ipynb (3)
  • M docs/examples/notebooks/Animations_and_Progress.ipynb (5)
  • M docs/examples/notebooks/Capturing Output.ipynb (21)
  • M docs/examples/notebooks/Script Magics.ipynb (4)
  • M docs/examples/notebooks/display_protocol.ipynb (4)
  • M docs/examples/notebooks/rmagic_extension.ipynb (20)
  • M docs/examples/notebooks/trapezoid_rule.ipynb (5)

Patch Links

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

@ellisonbg Brian, as I'm new to the block, would I have to install .14 dev in order to take advantage of your rewritten notebooks?

Contributor

bfroehle commented Nov 28, 2012

Wow that's great. Everything looks good to me. +1 for merging.

@ellisonbg #2537 already does not merge cleanly... how much effort is required in rebasing it and fixing the conflicts?

Contributor

bfroehle commented Nov 28, 2012

@takluyver takluyver referenced this pull request in ellisonbg/ipython Nov 28, 2012

Merged

Examples py3 compat #6

Owner

ellisonbg commented Nov 28, 2012

In think the notebooks themselves are ready to merge, but there was some question about my moving the examples directory to top level. Thoughts?

Sent from my iPad

On Nov 28, 2012, at 9:24 AM, "Bradley M. Froehle" notifications@github.com wrote:

Wow that's great. Everything looks good to me. +1 for merging.

@ellisonbg #2537 already does not merge cleanly... how much effort is required in rebasing it and fixing the conflicts?


Reply to this email directly or view it on GitHub.

Owner

takluyver commented Nov 28, 2012

I don't have strong feelings on that either way.

On 28 November 2012 22:45, Brian E. Granger notifications@github.comwrote:

In think the notebooks themselves are ready to merge, but there was some
question about my moving the examples directory to top level. Thoughts?

Sent from my iPad

On Nov 28, 2012, at 9:24 AM, "Bradley M. Froehle" <
notifications@github.com> wrote:

Wow that's great. Everything looks good to me. +1 for merging.

@ellisonbg #2537 already does not merge cleanly... how much effort is
required in rebasing it and fixing the conflicts?


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/pull/2627#issuecomment-10826667.

Contributor

bfroehle commented Nov 28, 2012

I have no opinion on the matter (docs/examples vs. examples).

Owner

ellisonbg commented Nov 28, 2012

OK I will follow up with @fperez and @minrk as they had opinions on this.

On Wed, Nov 28, 2012 at 2:52 PM, Bradley M. Froehle <
notifications@github.com> wrote:

I have no opinion on the matter (docs/examples vs. examples).


Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/pull/2627#issuecomment-10826912.

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

Owner

minrk commented Nov 29, 2012

I don't care about moving the examples out of the docs directory (benefit is negligible, and cost is minor), but in doing so, you must also take care of the literalinclude calls that currently depend on examples (update the paths, duplicate the files, or some such). An earlier rewrite of an example (options pricer, I think?) already broke one of these, so clearly people are not paying attention to this.

Owner

ellisonbg commented Nov 29, 2012

OK, minimally I will go through and fix all of that.

On Wed, Nov 28, 2012 at 4:22 PM, Min RK notifications@github.com wrote:

I don't care about moving the examples out of the docs directory (benefit
is negligible, and cost is minor), but in doing so, you must also take care
of the literalinclude calls that currently depend on examples (update the
paths, duplicate the files, or some such). An earlier rewrite of an example
(options pricer, I think?) already broke one of these, so clearly people
are not paying attention to this.


Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/pull/2627#issuecomment-10829667.

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

Contributor

bfroehle commented Dec 7, 2012

Thanks @takluyver for the work here. Unless @ellisonbg thinks he will get to the notebook restructuring soon, I think we should consider merging this now.

Owner

takluyver commented Dec 7, 2012

It would be nice to get this done, but I don't think it's urgent, and I
don't want to make more conflicts for @ellisonbg. I've submitted a pull
request against his branch as well:

ellisonbg#6

On 7 December 2012 21:31, Bradley M. Froehle notifications@github.comwrote:

Thanks @takluyver https://github.com/takluyver for the work here.
Unless @ellisonbg https://github.com/ellisonbg thinks he will get to
the notebook restructuring soon, I think we should consider merging this
now.


Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/pull/2627#issuecomment-11147293.

Owner

ellisonbg commented Dec 10, 2012

Thomas, OK I will try to get to this soon and will make sure to grab the PR
against my branch first.

On Fri, Dec 7, 2012 at 2:30 PM, Thomas Kluyver notifications@github.comwrote:

It would be nice to get this done, but I don't think it's urgent, and I
don't want to make more conflicts for @ellisonbg. I've submitted a pull
request against his branch as well:

ellisonbg#6

On 7 December 2012 21:31, Bradley M. Froehle notifications@github.comwrote:

Thanks @takluyver https://github.com/takluyver for the work here.
Unless @ellisonbg https://github.com/ellisonbg thinks he will get to
the notebook restructuring soon, I think we should consider merging this
now.


Reply to this email directly or view it on GitHub<
https://github.com/ipython/ipython/pull/2627#issuecomment-11147293>.


Reply to this email directly or view it on GitHubhttps://github.com/ipython/ipython/pull/2627#issuecomment-11149210.

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

Owner

ellisonbg commented Jan 14, 2013

@takluyver I have merged your PR against my branch. I am going to finish the work on my branch now so we can merge it. Does this PR have anything in addition or can it be closed?

Owner

takluyver commented Jan 14, 2013

Thanks Brian. Nope, it should be the same stuff. Closing this one.

@takluyver takluyver closed this Jan 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment