zipline-live / zipline

Zipline-Live, a Pythonic Algorithmic Trading Library
http://www.zipline-live.io/
Apache License 2.0
395 stars 65 forks source link

Test fixes caused by Live Broker PR #17

Closed tibkiss closed 7 years ago

tibkiss commented 7 years ago

Please hold on with the merge, I need to fix the Python3 related issues first.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling c3f0cd5a1f95bc3a2ae878329406ff2ee4e39041 on tibkiss:test_fixes into on zipline-live:live.

tibkiss commented 7 years ago

Finally a semi-green build. The failing testcases (test_examples under Python3 @ Travis) are likely related to the ^GSPC -> SPY change. I'm not sure how to fix the missing ibpy2 package under appveyor (and I'm not so motivated to fix the problems for windows platform....)

@bartosh / @pbharrin : Could you please review this PR?

bartosh commented 7 years ago

Great work! Thank you for fixing this!

Hmm, I should've run python3 tests. Remaining issues look like unicode and python3 specific ones.

Will look at them tomorrow.

We need to fix all failures, including windows ones I believe.

pbharrin commented 7 years ago

The error appears to be Python 3 reading a pickle that was written in Python 2.
See this post.

This is happening with the different example algorithms: olmar, buyapple, etc.

I think this stems from creating new algo results for the new benchmark SPY. We should figure out how to create the tests/resources/example_data.tar.gz without creating this issue.

pbharrin commented 7 years ago

Here is a link to the Pickle library section on data formats perhaps setting this when creating example_data.tar.gz will solve this problem.
https://docs.python.org/3.4/library/pickle.html#data-stream-format

tibkiss commented 7 years ago

It makes me wonder how is this problem not present in quantopian's zipline?

pbharrin commented 7 years ago

@bartosh How was this file created?

bartosh commented 7 years ago

I think the problem can be solved by running tests/resources/rebuild_example_data from python3. It will use pickle:2 serialization which should work for both python versions.