Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for statistics is failing under Python 2.7 #45

Closed
femtotrader opened this issue Jun 23, 2016 · 6 comments
Closed

Test for statistics is failing under Python 2.7 #45

femtotrader opened this issue Jun 23, 2016 · 6 comments
Labels

Comments

@femtotrader
Copy link
Contributor

$ source activate py27
prepending //anaconda/envs/py27/bin to PATH
((py27)) pc:femto femto$ python qstrader/statistics/statistics_test.py
//anaconda/envs/py27/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
//anaconda/envs/py27/lib/python2.7/site-packages/IPython/html.py:14: ShimWarning: The `IPython.html` package has been deprecated. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`.
  "`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)
F
======================================================================
FAIL: test_calculating_statistics (__main__.TestSimpleStatistics)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "qstrader/statistics/statistics_test.py", line 159, in test_calculating_statistics
    self.assertEqual(results["sharpe"], Decimal("1.8353"))
AssertionError: 1.8353 != Decimal('1.8353')

----------------------------------------------------------------------
Ran 1 test in 0.099s

FAILED (failures=1)
@femtotrader
Copy link
Contributor Author

We probably don't need decimal precision for sharpe ratio

So we should change (at least temporarily)

    self.assertEqual(results["sharpe"], Decimal("1.8353"))

to

    self.assertEqual(results["sharpe"], 1.8353)

@femtotrader
Copy link
Contributor Author

Hum... bad idea...
because it's failling now under Python 3 (and not under Python 2!)

@femtotrader
Copy link
Contributor Author

femtotrader commented Jun 23, 2016

This test have been commented for CI passing.
This issue is still alive

# ToFix: https://github.com/mhallsmoore/qstrader/issues/45

@femtotrader
Copy link
Contributor Author

This test can be run using

    self.assertAlmostEqual(float(results["sharpe"]), 1.8353)

@mhallsmoore
Copy link
Owner

This is fixed now right?

@femtotrader
Copy link
Contributor Author

Yes fixed by bffc1a1

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants