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

warn when notebook is started in pylab mode #4788

Merged
merged 2 commits into from Jan 14, 2014

Conversation

minrk
Copy link
Member

@minrk minrk commented Jan 12, 2014

because it is always a bad idea

Hopefully we will actually deprecate specifying kernel args at notebook launch, but that won't be for a while. Warning about the most harmful and common option seems like a good compromise.

self.log.warn('\n '.join([
"Starting all kernels in pylab mode is not recommended.",
"Please use the %matplotlib magic to enable matplotlib instead.",
"The imports `--pylab` makes can have confusing side effects",
Copy link
Member

Choose a reason for hiding this comment

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

makes can? does this construction make sense in /English?

Copy link
Member Author

Choose a reason for hiding this comment

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

It does make sense, but I'll try to word it a little better.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks :-)

because it is always a bad idea
@ivanov
Copy link
Member

ivanov commented Jan 12, 2014

How about "Please use --matplotlib flag which will run the %matplotlib magic for every notebook"?

@minrk
Copy link
Member Author

minrk commented Jan 12, 2014

I'm not sure I would even recommend using --matplotlib, because then if someone who didn't use that flag runs your notebook, it will hang.

@minrk
Copy link
Member Author

minrk commented Jan 12, 2014

Plus, I am hoping to remove support for specifying kernel flags at the server command-line, which would disable --matplotlib as well.

@damianavila
Copy link
Member

OK, it is more clear to me now...

Plus, I am hoping to remove support for specifying kernel flags at the server command-line, which would disable --matplotlib as well.

I totally agree...

@Carreau
Copy link
Member

Carreau commented Jan 13, 2014

+1 , I would have been even more annoying by asking the user :
"aren't you sure you don't want not to use --pylab ? [y/n]" with a random number of extra negation at each startup.

BTW, can we have colors in logs ?

"Starting all kernels in pylab mode is not recommended.",
"Please use the %matplotlib magic to enable matplotlib instead.",
"pylab implies many imports, which can have confusing side effects",
"and harm the reproducibility of your notebooks.",
Copy link
Member Author

Choose a reason for hiding this comment

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

add a note that this will be deprecated

takluyver added a commit that referenced this pull request Jan 14, 2014
warn when notebook is started in pylab mode
@takluyver takluyver merged commit 48ff4fc into ipython:master Jan 14, 2014
@minrk minrk deleted the warn-pylab-notebook branch March 31, 2014 23:36
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
warn when notebook is started in pylab mode
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

5 participants