Closed llorracc closed 3 years ago
The code snippet below, which was created long ago so that the .py files created by jupytext could be run directly from the command line via python [filename].py
, now generates an error. The notebook runs fine without it. I've searched and that text is scattered throughout notebooks in many places, from which it should probably be removed if it is no longer needed for the original purpose.
One puzzle, though, is that the exact same notebook worked fine when launched with myBinder via econ-ark.org.
@MridulS, could you propose what we should do about this? Options include:
# Determine whether to make the figures inline (for spyder or jupyter)
# vs whatever is the automatic setting that will apply if run from the terminal
if in_ipynb():
%matplotlib inline generates a syntax error when run from the shell
# so do this instead
get_ipython().run_line_magic('matplotlib', 'inline')
else:
get_ipython().run_line_magic('matplotlib', 'auto')
# Import the plot-figure library matplotlib
I would vote to remove this from everywhere. inline
has been the default backend in ipython for a long time now https://github.com/ipython/ipykernel/blob/master/docs/changelog.md#440
so unless someone is actively going about and changing the matplotlib backend it should work okay.
Also it should be ipython [filename].py
instead of python [filename].py
.
I would vote to remove this from everywhere.
inline
has been the default backend in ipython for a long time now https://github.com/ipython/ipykernel/blob/master/docs/changelog.md#440
Shows you how long this code has been around!
I'll remove it everywhere.
PS. You're right: ipython
not python
at the command line.
time.clock -> time.time, remove outdated test for magics