William Stein wrote:
> On Fri, Jan 30, 2009 at 8:52 AM, Carl Witty <carl.wi...@gmail.com> wrote:
>> On Thu, Jan 29, 2009 at 5:49 PM, William Stein <wst...@gmail.com> wrote:
>>> On Wed, Jan 28, 2009 at 10:07 PM, Jason Grout
>>> <jason-s...@creativetrax.com> wrote:
>>>> I just finished upgrading the matplotlib spkg to the newest version.
>>>> See http://trac.sagemath.org/sage_trac/ticket/4774
>>>>
>>>> This version of matplotlib deprecates some of the constructs found in
>>>> Sage's matplotlibrc (which is located in $SAGE_ROOT and automatically
>>>> copied to $DOT_SAGE if needed every time sage starts up).  The result is
>>>> a bunch of deprecation warnings every time Sage starts up (when
>>>> matplotlib loads Sage's matplotlibrc file).  In trying to figure out
>>>> what to do about this with several other developers, one option that
>>>> came up was just throwing away/ignoring the special Sage matplotlibrc
>>>> and using the normal, standard defaults for matplotlibrc (including the
>>>> standard location for a customized matplotlibrc).
>>>>
>>>> In investigating things more deeply, there were only a few real changes
>>>> we made to the default behavior of matplotlib.  IIRC, a few font choices
>>>> were reordered, legends were changed to display a bit more of the
>>>> function, and the dpi of saved images was bumped up from 80 dpi to 100
>>>> dpi (but this should be set when Sage saves an image anyway, so I don't
>>>> know that this changes anything).
>>>>
>>>> So here's a proposal: Should Sage stop distributing a custom
>>>> matplotlibrc, and ignore matplotlibrc files that already exist in the
>>>> $DOT_SAGE directories?
>>>>
>>>> Note that if people really want to customize the matplotlib settings,
>>>> they can always use the standard location for matplotlibrc (i.e.,
>>>> ~/.matplotlib/matplotlibrc, I think).  This will clean code out of the
>>>> bin repository and reduce startup time for sage as well.  Patches which
>>>> do this are posted to #4774.
>>>>
>>>> I vote yes, provided some sort of note is made in the release notes
>>>> about the ignored matplotlibrc file.
>>> I vote no, since I created the $DOT_SAGE/matplotlib directory
>>> *precisely* because of problems that happen if you were to do what you
>>> describe above.  For starters, people often also used a system-wide
>>> Python with their own version of matplotlib -- then end result was
>>> that if they tried to switch back and forth between sage and
>>> python/ipython/matplotlib, they would get tons of deprecation
>>> warnings, since the systemwide version of matplotlib is often
>>> different than the sage version.
>>>
>>> Second, how will what you suggest solve any problems?  All you do is
>>> move the problem from $DOT_SAGE/matplotlib/matplotlibc to
>>> $HOME/.matplotlibrc.  It's exactly the same problem.   You just
>>> temporarily put it off for a while.
>> I don't understand this.  As I understand it, the proposal is to not
>> do anything with matplotlibrc (don't ship any "Sage" version at all),
>> so almost everybody will not have a matplotlibrc.  The problem is
>> fixed permanently for those people.    We're left with the people who
>> actually read the matplotlib documentation, notice the existence of
>> matplotlibrc, and create their own matplotlibrc file.
> 
> IIRC matplotlib *creates* or copies a matplotlibrc file into place the
> first time it is run if one isn't there.  This is the case at least
> with ipython, and I think with matplotlibrc.  Everything I said above
> was under that assumption.  If it isn't true for matplotlibrc than I
> take it back.
> 
> OK, as a test I deleted the matplotlibrc file I have, started up sage,
> and drew a plot.    No matplotlibrc is created.
> 
> So never mind what I said :-)

Well, there is something to be said for what you said.  We ship our own 
version of matplotlib,  which mostly likely is different than the system 
install.  That means that their perfectly good default matplotlibrc file 
might cause deprecation warnings for us.  For that reason, I think we 
should still set the MATPLOTLIBRC environment variable to point to a 
location within $DOT_SAGE.

For that reason, how about yet another proposal:

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 *delete* the matplotlibrc.  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 older 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 current 
sage default matplotlibrc, then throw a warning with a helpful error 
message about updating the matplotlibrc (and where to find the file).


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