<br><br><div class="gmail_quote">On Sat, Jun 2, 2012 at 8:18 PM, Fernando Perez <span dir="ltr"><<a href="mailto:fperez.net@gmail.com" target="_blank">fperez.net@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Howdy,<br>
<br>
(this is likely for Min, but perhaps somebody else knows) I'm kind of<br>
stumped trying to figure out why this works fine in my config file:<br>
<br>
c.InlineBackend.figure_format = 'png' (or 'svg')<br>
<br>
but I can't seem to make this work:<br>
<br>
c.InlineBackend.rc['savefig.dpi'] = 96<br>
<br>
In fact, I get a traceback:<br>
<br>
[IPKernelApp] Exception while loading config file<br>
/home/fperez/.ipython/profile_default/ipython_notebook_config.py<br>
Traceback (most recent call last):<br>
File "/home/fperez/usr/lib/python2.7/site-packages/IPython/config/application.py",<br>
line 447, in load_config_file<br>
config = loader.load_config()<br>
File "/home/fperez/usr/lib/python2.7/site-packages/IPython/config/loader.py",<br>
line 269, in load_config<br>
self._read_file_as_dict()<br>
File "/home/fperez/usr/lib/python2.7/site-packages/IPython/config/loader.py",<br>
line 322, in _read_file_as_dict<br>
py3compat.execfile(conf_filename, namespace)<br>
File "/home/fperez/usr/lib/python2.7/site-packages/IPython/utils/py3compat.py",<br>
line 178, in execfile<br>
__builtin__.execfile(filename, *where)<br>
File "/home/fperez/.ipython/profile_default/ipython_notebook_config.py",<br>
line 7, in <module><br>
c.InlineBackend.rc['savefig.dpi'] = 96<br>
File "/home/fperez/usr/lib/python2.7/site-packages/IPython/config/loader.py",<br>
line 167, in __getattr__<br>
raise AttributeError(e)<br>
AttributeError: 'rc'<br>
<br>
<br>
If I make the same change inside the backend_inline file in IPython<br>
itself it does have an effect, but not in the config file, and I'm<br>
curious why... The rc field is a traitlet Dict.<br></blockquote><div><br></div><div>The Config file has no idea that rc is a dict (or that rc is an option at all).</div><div><br></div><div>The only thing you can do in config files is assignment:</div>
<div><br></div><div>c.InlineBackend.rc = {'savefig.dpi': 96}</div><div><br></div><div>Traitlets are not involved at all in the config files or the construction of the config object, they determine how the config object (after it is constructed by config files and command-line opts) is interpreted.</div>
<div><br></div><div>-MinRK</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Puzzled... Before I dig into the traitlets machinery to track this<br>
down, I figured I'd ask...<br>
<br>
f<br>
_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
</blockquote></div><br>