John Hunter wrote:
> On Fri, Jan 30, 2009 at 9:30 AM, Ondrej Certik <ond...@certik.cz> wrote:
> 
>>> I *wish* matplotlib would replace their stupid deprecation warnings by
>>> something that just updates the matplotlibrc file, and say makes a
>>> copy of the old one.  Is there any way we could catch the warnings and
>>> if they occur move $DOT_SAGE/matplotlib/matplotlibrc to another file,
>>> then put a new matplotlibrc in place and print a message that this
>>> just happened?  You could do that by making slightly patching
>>> matplotlib as well.  I think matplotlib's behavior of emitting
>>> warnings but doing nothing helpful to resolve them is just obnoxious.
>> Maybe matplotlib developers would accept a patch fixing this.
> 
> To address this problem, we went to an all commented out rc file.
> That way, when people change their mpl version, they don't get
> deprecation warnings.  Only people who make specific changes to their
> rc file will get deprecation warnings.  Those people will know what rc
> is and how to change it.  I'm disinclined to overwrite files people
> have changed -- they may be running multiple versions of mpl under
> different scenarios, and each version would be competing with one
> another to overwrite the file.  mpl has a general philospohy of not
> trying to be too helpful -- we want to make it easy for users to
> customize, we don't want to customize it for them.
> 
> The verbose deprecation warnings are in my opinion mostly a solved
> problem: get a new rc file which is all commented out.  Just change
> the things you want to change, and you will get very few warnings
> going forward.  When you get them, fix the problem and you will get no
> more warnings.


Okay, how about this strategy proposal instead:

1. Add a warnings handler which traps the Matplotlib deprecation 
warning.  This handler will compare the matplotlibrc with the one that 
was distributed in the last release (maybe by checking a hash value). 
If it is identical (i.e., the user hasn't modified the matplotlibrc), 
then replace the matplotlibrc with a commented-out version.  This is a 
bit tricky, since the sage default matplotlibrc is not under version 
control (it's in $SAGE_ROOT), so we don't know what old copies looked 
like.  (hehe...yet another reason to really like mabshoff for the 
library of old builds).  If the file is not identical to the sage 
default matplotlibrc, then throw a warning with a helpful error message 
about updating the matplotlibrc (and where to find the file).

2. Put the sage default matplotlibrc under version control inside the 
matplotlib spkg and copy it to someplace in $SAGE_ROOT/local for 
installation.  Delete the matplotlibrc in $SAGE_ROOT.

What do people think?

Jason


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to