1313def test_repr (raa ):
1414 np .testing .assert_array_equal (
1515 pd .read_html (raa ._repr_html_ ())[0 ].set_index ("Unnamed: 0" ).values ,
16- raa .to_frame ().values ,
16+ raa .to_frame (origin_as_datetime = False ).values ,
1717 )
1818
1919
2020def test_to_frame_unusual (clrd ):
21- a = clrd .groupby (["LOB" ]).sum ().latest_diagonal ["CumPaidLoss" ].to_frame ()
22- b = clrd .latest_diagonal ["CumPaidLoss" ].groupby (["LOB" ]).sum ().to_frame ()
21+ a = clrd .groupby (["LOB" ]).sum ().latest_diagonal ["CumPaidLoss" ].to_frame (origin_as_datetime = False )
22+ b = clrd .latest_diagonal ["CumPaidLoss" ].groupby (["LOB" ]).sum ().to_frame (origin_as_datetime = False )
2323 assert (a == b ).all ().all ()
2424
2525
@@ -112,7 +112,7 @@ def test_quantile_vs_median(clrd):
112112
113113
114114def test_base_minimum_exposure_triangle (raa ):
115- d = (raa .latest_diagonal * 0 + 50000 ).to_frame ().reset_index ()
115+ d = (raa .latest_diagonal * 0 + 50000 ).to_frame (origin_as_datetime = False ).reset_index ()
116116 d ["index" ] = d ["index" ].astype (str )
117117 cl .Triangle (d , origin = "index" , columns = d .columns [- 1 ])
118118
@@ -190,7 +190,7 @@ def test_dropna(clrd):
190190def test_exposure_tri ():
191191 x = cl .load_sample ("auto" )
192192 x = x [x .development == 12 ]
193- x = x ["paid" ].to_frame ().T .unstack ().reset_index ()
193+ x = x ["paid" ].to_frame (origin_as_datetime = False ).T .unstack ().reset_index ()
194194 x .columns = ["LOB" , "origin" , "paid" ]
195195 x .origin = x .origin .astype (str )
196196 y = cl .Triangle (x , origin = "origin" , index = "LOB" , columns = "paid" )
@@ -215,13 +215,13 @@ def test_jagged_2_add(raa):
215215
216216def test_df_period_input (raa ):
217217 d = raa .latest_diagonal
218- df = d .to_frame ().reset_index ()
218+ df = d .to_frame (origin_as_datetime = False ).reset_index ()
219219 assert cl .Triangle (df , origin = "index" , columns = df .columns [- 1 ]) == d
220220
221221
222222def test_trend_on_vector (raa ):
223223 d = raa .latest_diagonal
224- assert d .trend (0.05 , axis = 2 ).to_frame ().astype (int ).iloc [0 , 0 ] == 29217
224+ assert d .trend (0.05 , axis = 2 ).to_frame (origin_as_datetime = False ).astype (int ).iloc [0 , 0 ] == 29217
225225
226226
227227def test_latest_diagonal_val_to_dev (raa ):
@@ -248,11 +248,12 @@ def test_groupby_axis1(clrd, prism):
248248 clrd = clrd .sum ("origin" ).sum ("development" )
249249 groups = [i .find ("Loss" ) >= 0 for i in clrd .columns ]
250250 assert np .all (
251- clrd .to_frame ().groupby (groups , axis = 1 ).sum ()
252- == clrd .groupby (groups , axis = 1 ).sum ().to_frame ()
251+ clrd .to_frame (origin_as_datetime = False ).groupby (groups , axis = 1 ).sum ()
252+ == clrd .groupby (groups , axis = 1 ).sum ().to_frame (origin_as_datetime = False )
253253 )
254254 assert np .all (
255- clrd .to_frame ().groupby ("LOB" ).sum () == clrd .groupby ("LOB" ).sum ().to_frame ()
255+ clrd .to_frame (origin_as_datetime = False ).groupby ("LOB" ).sum () ==
256+ clrd .groupby ("LOB" ).sum ().to_frame (origin_as_datetime = False )
256257 )
257258 prism .sum ().grain ("OYDY" )
258259
@@ -262,7 +263,7 @@ def test_partial_year(prism):
262263 before = before [before .valuation <= '2017-08' ].latest_diagonal
263264
264265 after = cl .Triangle (
265- before .to_frame (keepdims = True ).reset_index (),
266+ before .to_frame (keepdims = True , origin_as_datetime = True ).reset_index (),
266267 origin = 'origin' , development = 'valuation' , columns = 'Paid' , index = before .key_labels )
267268
268269 assert after .valuation_date == before .valuation_date
@@ -294,7 +295,7 @@ def test_shift(raa):
294295 assert (
295296 raa .iloc [..., 1 :- 1 , 1 :- 1 ] -
296297 raa .shift (- 1 , axis = 2 ).shift (- 1 , axis = 3 ).shift (2 , axis = 2 ).shift (2 , axis = 3 ).dropna ().values
297- ).to_frame ().fillna (0 ).sum ().sum () == 0
298+ ).to_frame (origin_as_datetime = False ).fillna (0 ).sum ().sum () == 0
298299
299300
300301def test_array_protocol2 (raa ):
@@ -305,7 +306,7 @@ def test_array_protocol2(raa):
305306def test_create_full_triangle (raa ):
306307 a = cl .Chainladder ().fit (raa ).full_triangle_
307308 b = cl .Triangle (
308- a .to_frame (keepdims = True , implicit_axis = True ),
309+ a .to_frame (keepdims = True , implicit_axis = True , origin_as_datetime = True ),
309310 origin = 'origin' , development = 'valuation' , columns = 'values' )
310311 assert a == b
311312
@@ -322,7 +323,7 @@ def test_virtual_column(prism):
322323
323324def test_correct_valutaion (raa ):
324325 new = cl .Triangle (
325- raa .iloc [..., :- 3 , :].latest_diagonal .to_frame (keepdims = True , implicit_axis = True ),
326+ raa .iloc [..., :- 3 , :].latest_diagonal .to_frame (keepdims = True , implicit_axis = True , origin_as_datetime = True ),
326327 origin = 'origin' , development = 'valuation' , columns = 'values' )
327328 assert new .valuation_date == raa .valuation_date
328329
@@ -391,7 +392,7 @@ def test_trailing_origin():
391392 assert tri .origin_close == 'JUN'
392393
393394def test_trailing_valuation ():
394- data = cl .load_sample ('raa' ).dev_to_val ().to_frame (keepdims = True )
395+ data = cl .load_sample ('raa' ).dev_to_val ().to_frame (keepdims = True , origin_as_datetime = True )
395396 data .valuation = (data .valuation .dt .year + 1 )* 100 + 3
396397 tri = cl .Triangle (data , origin = 'origin' , development = 'valuation' , columns = 'values' )
397398 assert tri .development .to_list () == [3 , 15 , 27 , 39 , 51 , 63 , 75 , 87 , 99 , 111 , 123 ]
@@ -409,7 +410,7 @@ def test_edgecase_236():
409410
410411
411412def test_to_frame_on_zero (clrd ):
412- assert len ((clrd * 0 ).latest_diagonal .to_frame ()) == 0
413+ assert len ((clrd * 0 ).latest_diagonal .to_frame (origin_as_datetime = False )) == 0
413414
414415def test_valuation_vector ():
415416 df = pd .DataFrame (
0 commit comments