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

Asset KeyError #959

Merged
merged 3 commits into from Jan 21, 2016

Conversation

Projects
None yet
3 participants
@richafrank
Member

richafrank commented Jan 20, 2016

Enable comparison of an Asset to an int64 on 32-bit python

by supporting any Integral. We use a number of mappings keyed by
int64, which otherwise raise KeyErrors for Assets.

Also ensures algo.current_sids() returns a list of Assets, instead of identifiers.

For #650 and #926

@@ -212,6 +212,7 @@ def test_asset_comparisons(self):
self.assertEqual(s_23, s_23)
self.assertEqual(s_23, 23)
self.assertEqual(23, s_23)
self.assertEqual(int64(23), s_23)

This comment has been minimized.

@llllllllll

llllllllll Jan 20, 2016

Member

let's also check np.int32 to be safe

y_as_int = y
elif isinstance(y, Integral):

This comment has been minimized.

@llllllllll

llllllllll Jan 20, 2016

Member

as we discussed, maybe make this isinstance(y, (np.int64, np.int32, Integral)) for performance.

This comment has been minimized.

@richafrank

richafrank Jan 21, 2016

Member

Added long as well.

@ssanderson ssanderson added the 32-bit label Jan 20, 2016

@richafrank richafrank force-pushed the asset_keyerror branch from e590f37 to e41961d Jan 20, 2016

@richafrank richafrank force-pushed the asset_keyerror branch from e41961d to c26a499 Jan 21, 2016

richafrank added some commits Jan 20, 2016

BUG: Enable comparison of an Asset to an int64 on 32-bit python
We use a number of mappings keyed by int64, which otherwise raised
KeyErrors for Assets.

@richafrank richafrank force-pushed the asset_keyerror branch from c26a499 to 46a47d4 Jan 21, 2016

richafrank added a commit that referenced this pull request Jan 21, 2016

@richafrank richafrank merged commit 4ee919a into master Jan 21, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@richafrank richafrank deleted the asset_keyerror branch Jan 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment