Skip to content

Commit

Permalink
make check more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichalowicz committed May 23, 2017
1 parent 489e22f commit ca60577
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zipline/lib/_windowtemplate.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ zipline.lib._intwindow
zipline.lib._datewindow
"""
from numpy cimport ndarray
from numpy import asanyarray, dtype
from numpy import asanyarray, dtype, issubdtype


class Exhausted(Exception):
Expand Down Expand Up @@ -145,7 +145,8 @@ cdef class AdjustedArrayWindow:
new_out = asanyarray(self.data[anchor - self.window_length:anchor])
if view_kwargs:
new_out = new_out.view(**view_kwargs)
if self.rounding_places is not None and new_out.dtype is dtype('float64'):
if self.rounding_places is not None and \
issubdtype(new_out.dtype, dtype('float64')):
new_out = new_out.round(self.rounding_places)
new_out.setflags(write=False)
self.output = new_out
Expand Down

0 comments on commit ca60577

Please sign in to comment.