@@ -631,7 +631,7 @@ def test_per_period_risk_basic(self):
631631 "risk" : [100.0 , 200.0 , 300.0 , 50.0 ],
632632 }
633633 )
634- result_df = RiskTrajectory ._per_period_risk (df_input )
634+ result_df = RiskTrajectory ._date_to_period_agg (df_input )
635635
636636 expected_df = pd .DataFrame (
637637 {
@@ -659,7 +659,7 @@ def test_per_period_risk_multiple_risk_cols(self):
659659 "exposure contribution" : [5.0 , 8.0 ],
660660 }
661661 )
662- result_df = RiskTrajectory ._per_period_risk (
662+ result_df = RiskTrajectory ._date_to_period_agg (
663663 df_input , colname = ["base risk" , "exposure contribution" ]
664664 )
665665
@@ -686,7 +686,9 @@ def test_per_period_risk_non_yearly_intervals(self):
686686 }
687687 )
688688 # Test with 'month' time_unit
689- result_df_month = RiskTrajectory ._per_period_risk (df_input , time_unit = "month" )
689+ result_df_month = RiskTrajectory ._date_to_period_agg (
690+ df_input , time_unit = "month"
691+ )
690692 expected_df_month = pd .DataFrame (
691693 {
692694 "period" : ["2023-01-01 to 2023-03-01" ],
@@ -710,7 +712,7 @@ def test_per_period_risk_non_yearly_intervals(self):
710712 "risk" : [10.0 , 20.0 , 40.0 ],
711713 }
712714 )
713- result_df_gap = RiskTrajectory ._per_period_risk (df_gap , time_unit = "month" )
715+ result_df_gap = RiskTrajectory ._date_to_period_agg (df_gap , time_unit = "month" )
714716 expected_df_gap = pd .DataFrame (
715717 {
716718 "period" : ["2023-01-01 to 2023-02-01" , "2023-04-01 to 2023-04-01" ],
0 commit comments