John Hunter wrote:
> On 4/9/07, Eric Firing <[EMAIL PROTECTED]> wrote:
> 
>> I also closed a couple others.  It would be nice to get many more of the
>> bug reports closed; I think some are obsolete, but some are pointing to
>> things that really should be fixed.  I am out of time for a while,
>> though; I need to work on other things.
> 
> I think it is a good plan to try and knock out as many of these as
> possible before the next release.  I'm pretty swamped until after next
> Monday because all my free time will be going to preparing for a
> python workshop with Fernando, but let's all try and do a bug or patch
> per day, and shoot for some time after Monday a week for Monday to do
> the release.
> In related news, Eric, I say you were working on the date format
> problem in the finance module.  Just so everyone is on the same page,
> yahoo changed their output format to '%Y-%m-%d' so I changed the
> format string in the finance module.  But people who have cached
> downloads in ~/.matplotlib/finance.cache will still have data in the
> old format.  Eric made some changes to support both with a try/except,
> but at some point we'll want to remove that for performance reasons,
> so the best course is to flush your cache.

John,

Thanks for the explanation.  I made another change.  It should still 
support both formats, but with only a single try/except to decide which 
format to use, so the performance penalty should be negligible.  The 
advantage is that we won't get questions (as we have at least once) 
about "why doesn't finance_demo.py work?"

Here are the relevant lines from finance.py (slightly mangled by the 
mailer, as usual):

     datefmt = None

     for line in lines[1:]:

         vals = line.split(',')

         if len(vals)!=7: continue
         datestr = vals[0]
         if datefmt is None:
             try:
                 datefmt = '%Y-%m-%d'
                 dt = datetime.date(*time.strptime(datestr, datefmt)[:3])
             except ValueError:
                 datefmt = '%d-%b-%y'  # Old Yahoo--cached file?
         dt = datetime.date(*time.strptime(datestr, datefmt)[:3])
         d = date2num(dt)


Eric

> 
> JDH


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to