#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# start = tp_datetime ( 2013 , 4 , 1 ) #NEWLINE# end = tp_datetime ( 2013 , 7 , 1 ) #NEWLINE# period = S3TimeSeriesPeriod ( start = start , end = end ) #NEWLINE# events = [ ( 1 , ( 2013 , 4 , 1 ) , ( 2013 , 4 , 7 ) , { #NEWLINE# #INDENT# 'base' : 10 , #NEWLINE# 'slope' : 2 , #NEWLINE# #UNINDENT# } , 'A' ) , ( 2 , ( 2013 , 4 , 3 ) , ( 2013 , 4 , 9 ) , { #NEWLINE# #INDENT# 'base' : 20 , #NEWLINE# 'slope' : 5 , #NEWLINE# #UNINDENT# } , 'A' ) , ( 3 , ( 2013 , 4 , 5 ) , ( 2013 , 4 , 11 ) , { #NEWLINE# #INDENT# 'base' : 30 , #NEWLINE# 'slope' : 2 , #NEWLINE# #UNINDENT# } , 'B' ) , ( 4 , ( 2013 , 4 , 7 ) , ( 2013 , 4 , 13 ) , { #NEWLINE# #INDENT# 'base' : 40 , #NEWLINE# 'slope' : 5 , #NEWLINE# #UNINDENT# } , 'B' ) , ( 5 , ( 2013 , 5 , 1 ) , ( 2013 , 5 , 10 ) , { #NEWLINE# #INDENT# 'base' : 50 , #NEWLINE# 'slope' : 5 , #NEWLINE# #UNINDENT# } , 'C' ) , ( 6 , ( 2013 , 5 , 3 ) , ( 2013 , 5 , 12 ) , { #NEWLINE# #INDENT# 'base' : 60 , #NEWLINE# 'slope' : 2 , #NEWLINE# #UNINDENT# } , 'C' ) , ( 7 , ( 2013 , 5 , 5 ) , ( 2013 , 5 , 14 ) , { #NEWLINE# #INDENT# 'base' : 70 , #NEWLINE# 'slope' : 5 , #NEWLINE# #UNINDENT# } , 'A' ) , ( 8 , ( 2013 , 5 , 7 ) , ( 2013 , 5 , 16 ) , { #NEWLINE# #INDENT# 'base' : 80 , #NEWLINE# 'slope' : 2 , #NEWLINE# #UNINDENT# } , 'A' ) , ( 9 , ( 2013 , 6 , 1 ) , ( 2013 , 6 , 20 ) , { #NEWLINE# #INDENT# 'base' : 100 , #NEWLINE# 'slope' : 4 , #NEWLINE# #UNINDENT# } , 'B' ) , ( 10 , ( 2013 , 6 , 3 ) , ( 2013 , 6 , 22 ) , { #NEWLINE# #INDENT# 'base' : 200 , #NEWLINE# 'slope' : 7 , #NEWLINE# #UNINDENT# } , 'B' ) , ( 11 , ( 2013 , 6 , 5 ) , ( 2013 , 6 , 24 ) , { #NEWLINE# #INDENT# 'base' : 300 , #NEWLINE# 'slope' : 4 , #NEWLINE# #UNINDENT# } , 'C' ) , ( 12 , ( 2013 , 6 , 12 ) , None , { #NEWLINE# #INDENT# 'base' : 400 , #NEWLINE# 'slope' : 7 , #NEWLINE# #UNINDENT# } , 'C' ) ] #NEWLINE# for ( event_id , start , end , values , row ) in events : #NEWLINE# #INDENT# event_start = ( tp_datetime ( * start ) if start else None ) #NEWLINE# event_end = ( tp_datetime ( * end ) if end else None ) #NEWLINE# event = S3TimeSeriesEvent ( event_id , start = event_start , end = event_end , values = values , row = row ) #NEWLINE# period . add_current ( event ) #NEWLINE# #UNINDENT# self . current_events = events #NEWLINE# events = [ ( 13 , ( 2012 , 8 , 1 ) , ( 2012 , 8 , 10 ) , { #NEWLINE# #INDENT# 'base' : 20 , #NEWLINE# 'slope' : 5 , #NEWLINE# #UNINDENT# } , 'A' ) , ( 14 , ( 2012 , 8 , 3 ) , ( 2012 , 8 , 12 ) , { #NEWLINE# #INDENT# 'base' : 20 , #NEWLINE# 'slope' : 5 , #NEWLINE# #UNINDENT# } , 'B' ) , ( 15 , None , ( 2012 , 8 , 14 ) , { #NEWLINE# #INDENT# 'base' : 20 , #NEWLINE# 'slope' : 5 , #NEWLINE# #UNINDENT# } , 'C' ) , ( 16 , ( 2012 , 8 , 7 ) , ( 2012 , 8 , 16 ) , { #NEWLINE# #INDENT# 'base' : 20 , #NEWLINE# 'slope' : 5 , #NEWLINE# #UNINDENT# } , 'C' ) ] #NEWLINE# for ( event_id , start , end , values , row ) in events : #NEWLINE# #INDENT# event_start = ( tp_datetime ( * start ) if start else None ) #NEWLINE# event_end = ( tp_datetime ( * end ) if end else None ) #NEWLINE# event = S3TimeSeriesEvent ( event_id , start = event_start , end = event_end , values = values , row = row ) #NEWLINE# period . add_previous ( event ) #NEWLINE# #UNINDENT# self . previous_events = events #NEWLINE# self . period = period