#18355: Some cleanup in finance/stock
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_review
           Type:         |    Milestone:  sage-6.7
  defect                 |   Resolution:
       Priority:  major  |    Merged in:
      Component:         |    Reviewers:  Volker Braun
  finance                |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  bce3bc4ae710a4eaea99587d9bffffe4f89f18f2
  Nathann Cohen          |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  public/18355           |
   Dependencies:         |
-------------------------+-------------------------------------------------
Changes (by vbraun):

 * reviewer:   => Volker Braun


Comment:

 Great! Can you also fix the # optional internet tests?
 {{{
 sage -t src/sage/finance/stock.py
 **********************************************************************
 File "src/sage/finance/stock.py", line 279, in
 sage.finance.stock.Stock.history
 Failed example:
     finance.Stock('vmw').history('Aug+13,+2007')[:5] # optional --
 internet
 Expected:
     [
      14-Aug-07 51.99 55.50 48.00 51.00   38253700,
      15-Aug-07 52.11 59.87 51.50 57.71   10487000,
      16-Aug-07 60.99 61.49 52.71 56.99    6641500,
      17-Aug-07 59.00 59.00 54.45 55.55    2983800,
      20-Aug-07 56.05 57.50 55.61 57.33    2077200
     ]
 Got:
     [
      14-Aug-07 50.00 55.50 48.00 51.00   38262850,
      15-Aug-07 52.11 59.87 51.50 57.71   10689100,
      16-Aug-07 60.99 61.49 52.71 56.99    6919500,
      17-Aug-07 59.00 59.00 54.45 55.55    3087000,
      20-Aug-07 56.05 57.50 55.61 57.33    2141900
     ]
 **********************************************************************
 File "src/sage/finance/stock.py", line 288, in
 sage.finance.stock.Stock.history
 Failed example:
     finance.Stock('F').history('Jan+3,+1978', 'Jul+7,+2008')[:5] #
 optional -- internet
 Expected:
     [
       3-Jan-78 0.00 1.93 1.89 1.89    1618200,
       4-Jan-78 0.00 1.89 1.87 1.88    2482700,
       5-Jan-78 0.00 1.89 1.84 1.84    2994900,
       6-Jan-78 0.00 1.84 1.82 1.83    3042500,
       9-Jan-78 0.00 1.81 1.79 1.81    3916400
     ]
 Got:
     [
      20-Aug-92 0.00 7.90 7.73 7.83    5492698,
      21-Aug-92 0.00 7.92 7.66 7.68    5345999,
      24-Aug-92 0.00 7.59 7.33 7.35   11056299,
      25-Aug-92 0.00 7.66 7.38 7.61    8875299,
      26-Aug-92 0.00 7.73 7.64 7.68    6447201
     ]
 **********************************************************************
 File "src/sage/finance/stock.py", line 302, in
 sage.finance.stock.Stock.history
 Failed example:
     finance.Stock('AAPL').history('Sep+1,+1900', 'Jan+1,+2000')[0:5] #
 optional -- internet
 Expected:
     [
       4-Jan-99 0.00 2.64 2.50 2.58  136126400,
       5-Jan-99 0.00 2.75 2.59 2.71  201441600,
       6-Jan-99 0.00 2.76 2.56 2.61  192643200,
       7-Jan-99 0.00 2.82 2.63 2.81  204145600,
       8-Jan-99 0.00 2.93 2.75 2.81   96960000
     ]
 Got:
     [
       4-Jan-99 0.00 1.51 1.43 1.47  238221200,
       5-Jan-99 0.00 1.57 1.48 1.55  352522800,
       6-Jan-99 0.00 1.58 1.46 1.49  337125600,
       7-Jan-99 0.00 1.61 1.50 1.61  357254800,
       8-Jan-99 0.00 1.67 1.57 1.61  169680000
     ]
 **********************************************************************
 File "src/sage/finance/stock.py", line 330, in
 sage.finance.stock.Stock.history
 Failed example:
     sage.finance.stock.Stock("AAPL",
 22144).history(startdate='Jan+1,+1990')[:5] #optional -- internet
 Expected:
     [
       2-Jan-90 0.00 9.38 8.75 9.31    6542800,
       3-Jan-90 0.00 9.50 9.38 9.38    7428400,
       4-Jan-90 0.00 9.69 9.31 9.41    7911200,
       5-Jan-90 0.00 9.56 9.25 9.44    4404000,
       8-Jan-90 0.00 9.50 9.25 9.50    3627600
     ]
 Got:
     [
       8-Jun-99 0.00 1.74 1.70 1.70   78414000,
       9-Jun-99 0.00 1.73 1.69 1.73   88446400,
      10-Jun-99 0.00 1.72 1.69 1.72   79262400,
      11-Jun-99 0.00 1.73 1.65 1.66   46261600,
      14-Jun-99 0.00 1.67 1.61 1.62   39270000
     ]
 **********************************************************************
 File "src/sage/finance/stock.py", line 388, in
 sage.finance.stock.Stock.open
 Failed example:
     c.history(startdate='Feb+1,+2008', enddate='Mar+1,+2008')[:5]    #
 optional -- internet
 Expected:
     [
       1-Feb-08 56.98 58.14 55.06 57.85    2473000,
       4-Feb-08 58.00 60.47 56.91 58.05    1816500,
       5-Feb-08 57.60 59.30 57.17 59.30    1709000,
       6-Feb-08 60.32 62.00 59.50 61.52    2191100,
       7-Feb-08 60.50 62.75 59.56 60.80    1511900
     ]
 Got:
     [
       1-Feb-08 56.98 58.14 55.06 57.85    2490481,
       4-Feb-08 58.00 60.47 56.91 58.05    1840709,
       5-Feb-08 57.60 59.30 57.17 59.30    1712179,
       6-Feb-08 60.32 62.00 59.50 61.52    2211775,
       7-Feb-08 60.50 62.75 59.56 60.80    1521651
     ]
 **********************************************************************
 File "src/sage/finance/stock.py", line 447, in
 sage.finance.stock.Stock.close
 Failed example:
     c.history(startdate='Feb+1,+2008', enddate='Mar+1,+2008')[:5]    #
 optional -- internet
 Expected:
     [
       1-Feb-08 56.98 58.14 55.06 57.85    2473000,
       4-Feb-08 58.00 60.47 56.91 58.05    1816500,
       5-Feb-08 57.60 59.30 57.17 59.30    1709000,
       6-Feb-08 60.32 62.00 59.50 61.52    2191100,
       7-Feb-08 60.50 62.75 59.56 60.80    1511900
     ]
 Got:
     [
       1-Feb-08 56.98 58.14 55.06 57.85    2490481,
       4-Feb-08 58.00 60.47 56.91 58.05    1840709,
       5-Feb-08 57.60 59.30 57.17 59.30    1712179,
       6-Feb-08 60.32 62.00 59.50 61.52    2211775,
       7-Feb-08 60.50 62.75 59.56 60.80    1521651
     ]
 **********************************************************************
 File "src/sage/finance/stock.py", line 580, in
 sage.finance.stock.Stock._get_data
 Failed example:
 
finance.Stock('aapl').history(startdate='Jan+1,+1990',enddate='Jan+1,+1991')[:2]
 # optional -- internet
 Expected:
     [
       2-Jan-90 0.00 2.34 2.19 2.33   26171200,
       3-Jan-90 0.00 2.38 2.34 2.34   29713600
     ]
 Got:
     [
       2-Jan-90 0.00 1.34 1.25 1.33   45799600,
       3-Jan-90 0.00 1.36 1.34 1.34   51998800
     ]
 **********************************************************************
 4 items had failures:
    1 of   3 in sage.finance.stock.Stock._get_data
    1 of   6 in sage.finance.stock.Stock.close
    4 of   6 in sage.finance.stock.Stock.history
    1 of   6 in sage.finance.stock.Stock.open
     [38 tests, 7 failures, 8.65 s]
 sage -t src/sage/finance/time_series.pyx
     [343 tests, 3.50 s]
 ----------------------------------------------------------------------
 sage -t src/sage/finance/stock.py  # 7 doctests failed
 ----------------------------------------------------------------------
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/18355#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to