Skip to content

Commit

Permalink
fix code different across numpy versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerry Manoim committed Aug 10, 2020
1 parent 6341111 commit 2757cca
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions zipline/testing/predicates.py
Expand Up @@ -577,11 +577,20 @@ def assert_array_equal(result,
"expected dtype: %s\n%s"
% (result_dtype, expected_dtype, _fmt_path(path))
)
f = partial(
np.testing.assert_array_compare,
compare_datetime_arrays,
header='Arrays are not equal',
)
try:
# Depending on the version of numpy testing func is in a different
# place
f = partial(
np.testing.utils.assert_array_compare,
compare_datetime_arrays,
header='Arrays are not equal',
)
except AttributeError:
f = partial(
np.testing.assert_array_compare,
compare_datetime_arrays,
header='Arrays are not equal',
)
elif array_decimal is not None and expected_dtype.kind not in {'O', 'S'}:
f = partial(
np.testing.assert_array_almost_equal,
Expand Down

0 comments on commit 2757cca

Please sign in to comment.