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

#3005 - Removed 'ipython -pylab' references #3007

Merged
merged 2 commits into from Apr 28, 2014
Merged

#3005 - Removed 'ipython -pylab' references #3007

merged 2 commits into from Apr 28, 2014

Conversation

cgardn
Copy link
Contributor

@cgardn cgardn commented Apr 24, 2014

This is a documentation fix for #3005. As referenced in the changelog, "ipython --pylab" is deprecated as of ipython v2.0, and will be removed completely in v3.0. The preferred method to enter the pylab environment is to call "%pylab" from the ipython shell directly.

@cgardn cgardn changed the title Removed 'ipython -pylab' references #3005 - Removed 'ipython -pylab' references Apr 24, 2014
@pelson
Copy link
Member

pelson commented Apr 24, 2014

Congratulations on your first contribution to a "large, serious project" 😄 - this looks good to me.

@jenshnielsen & @NelleV - care to comment?

@NelleV
Copy link
Member

NelleV commented Apr 24, 2014

To my understanding ipython --pylab isn't deprecated for python 2.0. The ipython notebook --pylab is deprecated. @Carreau, can you confirm ?

@Carreau
Copy link
Contributor

Carreau commented Apr 24, 2014

Yes indeed, but pylab is so much used that we might never totally drop support for it.
Still since 1.0, there shouldn't be references to --pylab in any of our docs,
we are even pushing. %pylab out of our doc, in favor of %matplotlib and explicit import.

We recommend not to use --pylab (even less -pylab), it still works in 2.0, might just print a warning if you start the notebook server on 2.0.

On 3.0, --pylab can still be use to start the terminal qtconsole/kernels, but the notebook server will not start if you pass the --pylab flag.

The internal reason is that starting wit 3.0 the notebook server will be able to start kernels in many languages (python, julia, R...) and passing the --pylab flag to the kernel make most of them crash as it makes no sens.

You can see Fernando's thinking on this matter which is to use explicit import.

From a teaching perspective, it is true that pylab mode in general does a lot of magics, and confuse beginners a lot as after it is not usable from scripts, it even import some IPython specific function, that you cannot use in a pure python script.

@NelleV
Copy link
Member

NelleV commented Apr 24, 2014

So this confirms that the option is only deprecated for the ipython notebook. We don't mention the notebook in the matplotlib documentation, thus we are not affected by this deprecation.

@@ -1,3 +1,11 @@
2014-04-23 Updated references to "ipython -pylab"
As of ipython 3.0, pylab mode can no longer be invoked at shell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be fixed. The pylab mode can still be invoked in the shell, but isn't the preferred way to do this. Also, I'd remove the mention of the notebook in this section, as we never refer to the notebook in the matplotlib documentation, and there are already to much confusion between the console and the notebook.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, the console/notebook distinction for this deprecation confused
me as well. Since the docs don't mention the notebook at all, I think it
would be best to close this pull request and discard the changes.

On Thu, Apr 24, 2014 at 8:02 AM, Varoquaux notifications@github.com wrote:

In CHANGELOG:

@@ -1,3 +1,11 @@
+2014-04-23 Updated references to "ipython -pylab"

  •       As of ipython 3.0, pylab mode can no longer be invoked at shell
    

This comment should be fixed. The pylab mode can still be invoked in the
shell, but isn't the preferred way to do this. Also, I'd remove the mention
of the notebook in this section, as we never refer to the notebook in the
matplotlib documentation, and there are already to much confusion between
the console and the notebook.


Reply to this email directly or view it on GitHubhttps://github.com//pull/3007/files#r11945383
.

@tacaswell
Copy link
Member

I disagree. The ipython devs are discouraging the use of --pylab, even if they are but deprecating it ask we should not be encouraging its use. I am also of the view that we should also look in to getting rid of pylab (but that is another discussion).

@pelson
Copy link
Member

pelson commented Apr 24, 2014

👍 with @tacaswell.
I wouldn't dream of encouraging anybody to use pylab, neither the IPython command line incantation nor the pylab module shipped with matplotlib - they are both confusing and an abuse of namespaces (which are a good idea, and we should do more of 😉).

@jenshnielsen
Copy link
Member

I Agree with @tacaswell since %pylab and %matplotlib magics works in all IPython instances (QT, terminal and notebook) while the --pylab flag doesn't work in the notebook the best way to make it non confusing for the end user is to not mention the flag but only the %magic. I also agree with @pelson that matplotlib should not recommend the use of %matplotlib magic and explicit imports over %pylab.

@NelleV
Copy link
Member

NelleV commented Apr 24, 2014

I use the --pylab ipython option daily (in contrast, I've opened a notebook once in three years) for my research, and I find it extremely useful for interactive purposes. I think it would be a great loss if the concept of pylab completely disappeared (and there is no mention of such idea).

I think the problem of this option with the notebook is that notebooks are meant to be reran (in contrast with an interactive session). Thus, people ended up with notebooks with code that didn't run if you didn't launch the ipython notebook with the correct option (which doesn't happen in the case of a normal ipython session: if you didn't import matplotlib in your script, the script failed consistently whether or not you launched ipython with --pylab).

I'm for the change of this PR, but I do think that it should not be mentionned that the --pylab option is deprecated, as this is not the case, and we shouldn't mention the notebook here. You can replace this part with the fact that %pylab is now the preferred way to open a pylab ipython environment.

@jenshnielsen
Copy link
Member

The main problem with pylab apart from the reproducibility are weird issues where scripts don't work because the buildin python functions are overwritten (i.e.pythons sum is replace with numpy's sum function) This has resulted in more than one IPython bug report along the line of "this works in regular python but fails in IPython"

Agreed that there is no need to mention the notebook in the changelog and instead mention that %pylab magic is preferred.

@cgardn
Copy link
Contributor Author

cgardn commented Apr 24, 2014

Alright, I've updated the changelog to simply state that the %pylab magic is preferred, and removed one reference to the notebook. The documentation now only gives examples using the %pylab magic, and does not mention the notebook (except for one reference in the "what's new in 1.3.1 section") or the "--pylab" flag.

@tacaswell
Copy link
Member

@NelleV Are you happy with this version of the text?

👍 from me to merge.

@tacaswell tacaswell added this to the v1.4.0 milestone Apr 27, 2014
NelleV added a commit that referenced this pull request Apr 28, 2014
#3005 - Removed 'ipython -pylab' references
@NelleV NelleV merged commit 4d05931 into matplotlib:v1.3.x Apr 28, 2014
@cgardn cgardn deleted the issue3005 branch April 28, 2014 21:57
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.

None yet

7 participants