def __init__(self, sliding_window_length, dir=None): self.cache = None self.sliding_window_length = sliding_window_length self.__current_date = self.sliding_window_length self.dir = os.getcwd() + dir cycles = '111222000334440001122200111222000334440001122200111222000334440001122200' * 31 dates = Fixture1.populate_observations(cycles, date(2011, 1, 1)) self.time_constrained_tickers = [] self._populate_probabilities() self.fund_price_matrix = None self.benchmark_marketweight_matrix = None self._create_tickers() self.dates = self._get_dates()
def test_last_cycle_start8(self): dates = Fixture1.populate_observations('0344400011122200033', date(2016, 1, 1)) self.predictor.get_cycle_obs(date(2016, 1, 1)) last_start = self.predictor.get_last_cycle_start() self.assertTrue(dates[1] == last_start)