Charles Fox | 24 Jun 14:42 2015
Picon

Fast jump to error lines?

Hi all,

I just joined this list to ask a question that's been bugging me for ages, I wonder if anyone has any suggestions:

I'd like to optimize my IPython workflow some more.   I work in IPython and vim, using "ed" to enter Vim for ipython.   When my program dies I see the backtrace, make a mental note of the file and line number of the error, type "ed <filename>" then use ":" in vim to jump to the error line.   I'd like to reduce the cognitive load here by defining an ipython command that does this automatically.   So when I see the backtrace, I type a command and it opens vim with the right file and error line.

I think like most iPython users, doing this debuging dance takes up a significant portion of my day, so it seems worth automating.   But it seems strange that no-one has already built this yet -- is there some reason  for that?   Maybe some feature already exists to do this that I don't yet know about?   Or is there a technical problem to build it?

Is anyone else wanting a tool like this?

I looked at IPython internals just a little bit to tweak the debugger displays before, but I'm not sure where this feature would live, or how to access the backtrace text from the ipython console programatically.   I'd want to parse out the filename and line number than open vim with "+<linenumber>", from within IPython code.  Any suggestions could be really useful?   Could it be done as a magic or does it need changes to IPython code itself?


_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
triccare | 11 May 16:10 2015
Picon

How to flag code cells to not execute

Greetings,

Often I find myself trying a number of things, creating many, many code
cells. Eventually, I get a set of code cells that do what I want.

However, I do not want to delete the less-desirable code cells, either to
remember what was tried, or provide alternate methods.  But, on reloading
the notebook and/or re-running all the cells, it would be great to be able
to flag these cells to not execute.

Changing the cell type will loose the code formatting. I want the cells to
remain code cells, just not actually execute the code.

Is there a way to get the above? And if not, this would be a feature
request.

Thank you for your time,
t

--
View this message in context: http://python.6.x6.nabble.com/How-to-flag-code-cells-to-not-execute-tp5094568.html
Sent from the IPython - User mailing list archive at Nabble.com.
Emanuele Olivetti | 4 May 16:27 2015

Issues with IPython and emacs (in ubuntu 14.04)

Hi,

I recently upgraded my laptop from Ubuntu 12.04 LTS to 14.04 LTS. As a
consequence, IPython was upgraded from v0.12.1 to v1.2.1. I am very happy
with the more recent IPython, but I am also experiencing a number of
issues with its use within emacs, both v23 and v24, like: "py-execute-buffer"
(C-c C-c) not working, "py-execute-region" (C-c |) not working, TAB-completion
not working, among others.
With IPython v.0.12.1 everything was working well within emacs.

I followed these instructions on the IPython website:
   http://ipython.org/ipython-doc/1/config/editors.html
and removed all my emacs customizations in order to understand where the
issue is. My .emacs is now just
   (require 'ipython)
as suggested there. Notice that the python-mode package shipped with
Ubuntu 14.04 is v6.1.3, which should be recent enough.

I also tried the instructions for the more recent IPtyhon v3.x:
http://ipython.org/ipython-doc/3/config/details.html#editor-configuration
Which boil down to:
   (require 'python)
   (setq python-shell-interpreter "ipython")
Still no luck.

I then upgraded python-mode.el with the most recent one (dev, i.e >v0.6.2.0)
available from here:
   https://launchpad.net/python-mode
and many issues disappeared with the following .emacs:
   (add-to-list 'load-path "/PATH_TO/python-mode/")
   (setq py-install-directory "/PATH_TO/python-mode/")
   (require 'ipython)
   (setq python-shell-interpreter "ipython")
   (require 'python-mode)

Still "py-execute-region" (C-c |) is not working, with different output in
emacs v24 ("Indentation error") vs. emacs v23 (hangs).

What is your working set-up for emacs and IPython? Is there a way to make
it work well as it was before?

Thanks,

Emanuele
Anton Shatenfeld | 25 Apr 08:06 2015

Key "b" does not work

Hi,

For some reason I can't use "b" key in iPython, when I press "b" it does not appear in the input, but it makes a noise like a bell character, on the other hand "B" (Shift + "b") works fine.

I use:
OS X 10.10.3
Darwin Kernel Version 14.3.0
Terminal Version 2.5.3 (343.7)
bash-3.2
Python 3.4.2 and Python 2.7.6
IPython 3.1.0

The regular Python shell works fine.

Best,
Anton.
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Stefan Urbanek | 24 Apr 23:34 2015
Picon

Passing authenticated per-user identity to the server

Hi,

We are running the iPython server (built-in server) to which multiple users are being connected. The users are connecting to a database using SQLAlchemy. We want every user to connect to the database using his own credentials – we don't want to store the connection URL in the notebook. We can put the proper authorization into our library that the user will use in the notebook: special password, host based authorization, ... does not matter, the library can take care of that. However, we need to pass the information about the user (username, id, key, ...) to the library through the server. Something like this:

    from ourdblib import connect

    connnection = connect()

the connect() should get the user credentials for that particular user-browser session somehow (environment variable, python object, notebook variable, ...) . We can provide our own authentication, we can even have a front-end that can pass wsgi params or something, we just need to be able to pass the user's identity to the notebook server so it can be passed to the library.

In other words: if I'm using ipython notebook on the server, I want the server know about me. We can have our own tools to verify me and pass my identity to the server. What is the way to pass this information to the server?


How can we do that?

Thanks,

Stefan
--
I brew data.

Twitter: <at> Stiivi

_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Mike Sam | 20 Apr 20:00 2015
Picon

Long running notebooks

What is the best way to run long running (few hours) notebooks where you can close the laptop and come back to a running notebook and sync back to where things are?

Thanks,
Mike
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Rob Clewley | 19 Apr 02:14 2015
Picon

ipython notebook config options ignored unless placed in regular config file

Hi,

I'm using OS X 10.6.8 with ipython that I upgraded from v1 (from fink)
to 3.0.0 (using pip). Everything seems to work fine, except an issue
with configuration.

>From the documentation and my own testing, I am having trouble
understanding the expected behavior of config options in my
.ipython/profile_default/ipython_config.py versus the
ipython_notebook_config.py.

I want to auto-load a couple of extensions and modules for my
notebooks but not for my regular ipython sessions (partly because
those loads create warnings, but it just seems that I'm supposed to be
able to keep these configurations separate). It seemed to make sense
that config options that apply only to the notebook go in the notebook
config. But I can only get the notebook to honour my choices when I
put the options in ipython_config.py. It seems to ignore the notebook
config, and I am stuck with non-notebook ipython also loading these
modules. Am I doing something wrong?

The documentation does not explicitly address the distinctions, and
the inline comments in these files do not make reference to the
distinction between these two config files, only to inheritance of
TerminalIPythonApp from Application and InteractiveShellApp (but same
class names in both config files). What is the rule for notebook
config reading? Does ipython read from one first, then the other?
Currently, it seems to ignore the ipython_notebook_config.py
altogether, so why is it there?

Maybe it's related to this from 2013:
http://mail.scipy.org/pipermail/ipython-user/2013-February/012170.html
But the commit that fixed his problem is in the master repo now, so
maybe not...

The result of ipython notebook --debug is

[D 10:37:52.595 NotebookApp] Config changed:
[D 10:37:52.595 NotebookApp] {'NotebookApp': {'log_level': 10}}
[D 10:37:52.596 NotebookApp] IPYTHONDIR set to: /Users/robclewley/.ipython
[I 10:37:52.598 NotebookApp] Using existing profile dir:
u'/Users/robclewley/.ipython/profile_default'
[D 10:37:52.598 NotebookApp] Searching path
[u'/Users/robclewley/Work/literate_modeling/scenario-local-linear/notebook/project',
u'/Users/robclewley/.ipython/profile_default',
'/usr/local/etc/ipython', '/etc/ipython'] for config files
[D 10:37:52.598 NotebookApp] Attempting to load config file: ipython_config.py
[D 10:37:52.600 NotebookApp] Loaded config file:
/Users/robclewley/.ipython/profile_default/ipython_config.py
[D 10:37:52.601 NotebookApp] Config changed:
[D 10:37:52.601 NotebookApp] {'TerminalInteractiveShell': {'logstart':
True}, 'NotebookApp': {'log_level': 10}, 'TerminalIPythonApp':
{'matplotlib': 'osx'}}
[D 10:37:52.602 NotebookApp] Attempting to load config file:
ipython_notebook_config.py
[D 10:37:52.604 NotebookApp] Loaded config file:
/Users/robclewley/.ipython/profile_default/ipython_notebook_config.py
[D 10:37:52.605 NotebookApp] Config changed:
[D 10:37:52.605 NotebookApp] {'TerminalInteractiveShell': {'logstart':
True}, 'NotebookApp': {'log_level': 10}, 'InteractiveShellApp':
{'exec_lines': ['import notebook_importing'], 'gui': 'osx', 'pylab':
'osx', 'matplotlib': 'osx', 'extensions': ['yaml_magic',
'autoreload'], 'extra_extension': 'yaml_magic'}, 'TerminalIPythonApp':
{'extra_extension': 'yaml_magic', 'extensions': ['yaml_magic'],
'matplotlib': 'osx'}}
[D 10:37:52.611 NotebookApp] searching for local mathjax in
[u'/Users/robclewley/.ipython/nbextensions',
'/sw/share/jupyter/nbextensions',
'/usr/local/share/jupyter/nbextensions',
'/usr/share/jupyter/nbextensions']
[D 10:37:52.613 NotebookApp] searching for local mathjax in
[u'/Users/robclewley/.ipython/profile_default/static',
'/sw/lib/python2.7/site-packages/IPython/html/static']
[I 10:37:52.613 NotebookApp] Using MathJax from CDN:
https://cdn.mathjax.org/mathjax/latest/MathJax.js

For instance, invoking the magic command %%yaml (from my custom
extension) in the notebook results in a complaint that the command is
not recognized. If, instead, I set these extensions to be loaded in
ipython_config.py, then the notebook accepts %%yaml immediately. In
this case, the debug output is:

[D 10:46:50.330 NotebookApp] Config changed:
[D 10:46:50.330 NotebookApp] {'NotebookApp': {'log_level': 10}}
[D 10:46:50.331 NotebookApp] IPYTHONDIR set to: /Users/robclewley/.ipython
[I 10:46:50.332 NotebookApp] Using existing profile dir:
u'/Users/robclewley/.ipython/profile_default'
[D 10:46:50.332 NotebookApp] Searching path
[u'/Users/robclewley/Work/literate_modeling/scenario-local-linear/notebook/project',
u'/Users/robclewley/.ipython/profile_default',
'/usr/local/etc/ipython', '/etc/ipython'] for config files
[D 10:46:50.332 NotebookApp] Attempting to load config file: ipython_config.py
[D 10:46:50.335 NotebookApp] Loaded config file:
/Users/robclewley/.ipython/profile_default/ipython_config.py
[D 10:46:50.336 NotebookApp] Config changed:
[D 10:46:50.337 NotebookApp] {'TerminalInteractiveShell': {'logstart':
True}, 'NotebookApp': {'log_level': 10}, 'InteractiveShellApp':
{'extensions': ['yaml_magic', 'autoreload']}, 'TerminalIPythonApp':
{'matplotlib': 'osx'}}
[D 10:46:50.337 NotebookApp] Attempting to load config file:
ipython_notebook_config.py
[D 10:46:50.338 NotebookApp] Loaded config file:
/Users/robclewley/.ipython/profile_default/ipython_notebook_config.py
[D 10:46:50.339 NotebookApp] Config changed:
[D 10:46:50.340 NotebookApp] {'TerminalInteractiveShell': {'logstart':
True}, 'NotebookApp': {'log_level': 10}, 'InteractiveShellApp':
{'extra_extension': 'yaml_magic', 'extensions': ['yaml_magic',
'autoreload'], 'exec_lines': ['import notebook_importing'], 'gui':
'osx', 'pylab': 'osx', 'matplotlib': 'osx'}, 'TerminalIPythonApp':
{'extra_extension': 'yaml_magic', 'extensions': ['yaml_magic'],
'matplotlib': 'osx'}}
[D 10:46:50.345 NotebookApp] searching for local mathjax in
[u'/Users/robclewley/.ipython/nbextensions',
'/sw/share/jupyter/nbextensions',
'/usr/local/share/jupyter/nbextensions',
'/usr/share/jupyter/nbextensions']
[D 10:46:50.345 NotebookApp] searching for local mathjax in
[u'/Users/robclewley/.ipython/profile_default/static',
'/sw/lib/python2.7/site-packages/IPython/html/static']

Thanks.
Thomas Baruchel | 15 Apr 00:26 2015
Picon

Trouble with ipcluster on a Raspberry Pi

Hi,

I tried the command 'ipcluster start' on a Raspberry Pi 2. It starts 4 engines; then (one second later), it
says engines are stopping and it leaves.
I have no warning and no error but the enginres are being stopped one second after having been launched.

I also tried with 'ip start -n 2' with no difference.

Do you see where the issue may come from?

Regards,

--

-- 
Thomas Baruchel
debimax | 14 Apr 08:54 2015
Picon

css result different if cell splited

hi

*excuse me for my bad english.*
I use css to get counter for h1 h2 H3 h4

body{counter-reset: h1  h2 h3 h4 h5}
h1:before {counter-increment: h1;}
h2:before { content: counter(h2,upper-roman) "  "; counter-increment: h2; }
h3:before { content: counter(h2,upper-roman) "." counter(h3) "  ";  
counter-increment: h3; }
h4:before { content: counter(h2,upper-roman) "." counter(h3) "." counter(h4,
lower-alpha) ")  ";   counter-increment: h4; }
h1 { counter-reset: h2 h3 h4 h5;  }
h2 { counter-reset: h3 h4 h5;  }
h3 { counter-reset: h4 h5;}

div.cell  h2 { counter-reset: h3 0;
    border: 3px #ababab solid;
    background-color: #ddd;}

div.text_cell_render { font-size: 12pt;   line-height: 145%; }
div.text_cell_render h1{text-align: center;font-size: 24pt; color:#ff0000; 
text-decoration: underline;}
div.text_cell_render h2{font-size: 20pt;color:#ff0000;  text-decoration:
underline;}
div.text_cell_render h3{font-size: 14pt;color:#ff0000;  text-decoration:
underline;}
div.text_cell_render h4{font-size: 12pt;color:#ff0000;  text-decoration:
underline; }
div.text_cell_render h5 {font-weight: 300;}

It's ok if i use in one cell markdown:

but if cell is splited, i have problem with
 and counter-reset: h3 is not reset.

thank you for help me. 

--
View this message in context: http://python.6.x6.nabble.com/css-result-different-if-cell-splited-tp5092232.html
Sent from the IPython - User mailing list archive at Nabble.com.
Behzad Tabibian | 10 Apr 00:03 2015
Picon

adding new contents to nbconvert exported files

Hi,

I am trying to convert my notebooks to markdown and later use jekyll to show them on a github page. In some
parts of the notebooks I am using html tags such as <img src=“”/> which point to an image in local
directory. 

I need to setup the config.py such that it finds these links from markdown cells, replace them with an
appropriate url and copy the image to the files directory created by markdown converter. So far I have the
code that parses every markdown cell and runs them through regex to detect the image tags and the paths but I
don’t know how to add the file paths to output resources so that nbconvert copy the file to the export directory.

Can someone give me an idea how to do this?

Best,
Behzad
_______________________________________________
IPython-User mailing list
IPython-User <at> scipy.org
http://mail.scipy.org/mailman/listinfo/ipython-user
Hugo Gagnon | 4 Apr 23:33 2015

Propagating back only a few variables from a script ran with "%run -i"

Hi,

I am calling a script with "%run -i" and I would like to propagate back only a few variables from that script. 
How can I do that without deleting variables in my interactive namespace?

Thanks,
--

-- 
  Hugo Gagnon

Gmane