#NEWLINE# def test_read_no_adjustments( self ) : #NEWLINE# #INDENT# adjustment_reader = NullAdjustmentReader ( ) #NEWLINE# columns = [ USEquityPricing . close , USEquityPricing . volume ] #NEWLINE# query_days = self . calendar_days_between ( TEST_QUERY_START , TEST_QUERY_STOP ) #NEWLINE# shifted_query_days = self . calendar_days_between ( TEST_QUERY_START , TEST_QUERY_STOP , shift = ( - 1 ) ) #NEWLINE# adjustments = adjustment_reader . load_adjustments ( columns , query_days , self . assets ) #NEWLINE# self . assertEqual ( adjustments , [ { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ] ) #NEWLINE# pricing_loader = USEquityPricingLoader ( self . bcolz_daily_bar_reader , adjustment_reader ) #NEWLINE# results = pricing_loader . load_adjusted_array ( columns , dates = query_days , assets = self . assets , mask = ones ( ( len ( query_days ) , len ( self . assets ) ) , dtype = bool ) ) #NEWLINE# ( closes , volumes ) = map ( getitem ( results ) , columns ) #NEWLINE# expected_baseline_closes = expected_daily_bar_values_2d ( shifted_query_days , self . asset_info , 'close' ) #NEWLINE# expected_baseline_volumes = expected_daily_bar_values_2d ( shifted_query_days , self . asset_info , 'volume' ) #NEWLINE# for windowlen in range ( 1 , ( len ( query_days ) + 1 ) ) : #NEWLINE# #INDENT# for ( offset , window ) in enumerate ( closes . traverse ( windowlen ) ) : #NEWLINE# #INDENT# assert_array_equal ( expected_baseline_closes [ offset : ( offset + windowlen ) ] , window ) #NEWLINE# #UNINDENT# for ( offset , window ) in enumerate ( volumes . traverse ( query_days ) ) : #NEWLINE# #INDENT# assert_array_equal ( expected_baseline_volumes [ offset : ( offset + windowlen ) ] , window ) #NEWLINE# #UNINDENT# #UNINDENT# with self . assertRaises ( WindowLengthTooLong ) : #NEWLINE# #INDENT# closes . traverse ( ( windowlen + 1 ) ) #NEWLINE# #UNINDENT# with self . assertRaises ( WindowLengthTooLong ) : #NEWLINE# #INDENT# volumes . traverse ( ( windowlen + 1 ) )