Skip to content

from IPython import get_ipython #486

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

Closed
wants to merge 1 commit into from
Closed

from IPython import get_ipython #486

wants to merge 1 commit into from

Conversation

cclauss
Copy link
Member

@cclauss cclauss commented Oct 19, 2018

@harshildarji Help linters (and humans) understand where get_ipython() comes from.

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./machine_learning/logistic_regression.py:19:1: F821 undefined name 'get_ipython'
get_ipython().run_line_magic('matplotlib', 'inline')
^
1    F821 undefined name 'get_ipython'
1

@harshildarji
Copy link
Member

@cclauss To make from IPython import get_ipython work, we will have to run our script with ipython shell. Ordinary python shell will not work. So I think it is safe to comment out that line. User can remove the comment when they try to run with ipython or maybe in the notebook.

@cclauss
Copy link
Member Author

cclauss commented Oct 24, 2018

Alternative would be to try / catch ImportError but I think we are good as is... Thanks for your guidance on getting this done.

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