[IPython-dev] Small config puzzle

Fernando Perez fperez.net@gmail....
Sat Jun 2 22:18:35 CDT 2012


Howdy,

(this is likely for Min, but perhaps somebody else knows) I'm kind of
stumped trying to figure out why this works fine in my config file:

c.InlineBackend.figure_format = 'png'  (or 'svg')

but I can't seem to make this work:

c.InlineBackend.rc['savefig.dpi'] = 96

In fact, I get a traceback:

[IPKernelApp] Exception while loading config file
/home/fperez/.ipython/profile_default/ipython_notebook_config.py
Traceback (most recent call last):
  File "/home/fperez/usr/lib/python2.7/site-packages/IPython/config/application.py",
line 447, in load_config_file
    config = loader.load_config()
  File "/home/fperez/usr/lib/python2.7/site-packages/IPython/config/loader.py",
line 269, in load_config
    self._read_file_as_dict()
  File "/home/fperez/usr/lib/python2.7/site-packages/IPython/config/loader.py",
line 322, in _read_file_as_dict
    py3compat.execfile(conf_filename, namespace)
  File "/home/fperez/usr/lib/python2.7/site-packages/IPython/utils/py3compat.py",
line 178, in execfile
    __builtin__.execfile(filename, *where)
  File "/home/fperez/.ipython/profile_default/ipython_notebook_config.py",
line 7, in <module>
    c.InlineBackend.rc['savefig.dpi'] = 96
  File "/home/fperez/usr/lib/python2.7/site-packages/IPython/config/loader.py",
line 167, in __getattr__
    raise AttributeError(e)
AttributeError: 'rc'


If I make the same change inside the backend_inline file in IPython
itself it does have an effect, but not in the config file, and I'm
curious why...  The rc field is a traitlet Dict.

Puzzled...  Before I dig into the traitlets machinery to track this
down, I figured I'd ask...

f


More information about the IPython-dev mailing list