mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-02 12:30:45 +08:00
use dt.normalize() in pd>=0.20
This commit is contained in:
@@ -21,7 +21,6 @@ import datetime
|
||||
from math import sqrt
|
||||
|
||||
from nose_parameterized import parameterized
|
||||
from pandas.tslib import normalize_date
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import pytz
|
||||
@@ -1108,8 +1107,8 @@ class OrdersStopTestCase(WithSimParams,
|
||||
)),
|
||||
)
|
||||
days = pd.date_range(
|
||||
start=normalize_date(self.minutes[0]),
|
||||
end=normalize_date(self.minutes[-1])
|
||||
start=self.minutes[0].normalize(),
|
||||
end=self.minutes[-1].normalize()
|
||||
)
|
||||
with tmp_bcolz_equity_minute_bar_reader(
|
||||
self.trading_calendar, days, assets) as reader:
|
||||
|
||||
@@ -27,7 +27,6 @@ from pandas import (
|
||||
Series,
|
||||
Timestamp,
|
||||
)
|
||||
from pandas.tseries.tools import normalize_date
|
||||
from six import iteritems, itervalues
|
||||
|
||||
from catalyst.algorithm import TradingAlgorithm
|
||||
@@ -530,7 +529,7 @@ class PipelineAlgorithmTestCase(WithBcolzEquityDailyBarReaderFromCSVs,
|
||||
attach_pipeline(pipeline, 'test')
|
||||
|
||||
def handle_data(context, data):
|
||||
today = normalize_date(get_datetime())
|
||||
today = get_datetime().normalize()
|
||||
results = pipeline_output('test')
|
||||
expect_over_300 = {
|
||||
AAPL: today < self.AAPL_split_date,
|
||||
|
||||
@@ -395,7 +395,6 @@ def handle_data(context, data):
|
||||
|
||||
algocode = """
|
||||
from pandas import Timestamp
|
||||
from pandas.tseries.tools import normalize_date
|
||||
from catalyst.api import fetch_csv, record, sid, get_datetime
|
||||
|
||||
def initialize(context):
|
||||
@@ -411,7 +410,7 @@ def initialize(context):
|
||||
context.bar_count = 0
|
||||
|
||||
def handle_data(context, data):
|
||||
expected = context.expected_sids[normalize_date(get_datetime())]
|
||||
expected = context.expected_sids[get_datetime().normalize()]
|
||||
actual = data.fetcher_assets
|
||||
for stk in expected:
|
||||
if stk not in actual:
|
||||
|
||||
Reference in New Issue
Block a user