@@ -114,7 +114,7 @@ def test_closest_tune_approach(
114114 df_twiss [F1001 ] = df_cmatrix [F1001 ] # ignoring F1010 in this test as it is bigger than F1001
115115
116116 cta_df = closest_tune_approach (df_twiss , method = cta_method ) # only one column
117- cminus = cta_df .mean ().abs ()[0 ]
117+ cminus = cta_df .mean ().abs (). iloc [0 ]
118118 relative_error = _relative_error (cminus , _coupling_bump_teapot_cta )
119119
120120 assert relative_error <= max_relative_error_to_teapot
@@ -176,12 +176,13 @@ def test_coupling_rdt_bump_cmatrix_compare():
176176
177177def generate_fake_data (n ) -> tfs .TfsDataFrame :
178178 qx , qy = 1.31 , 1.32
179- df = tfs .TfsDataFrame (0 ,
180- index = [str (i ) for i in range (n )],
181- columns = [S , f"{ ALPHA } { X } " , f"{ ALPHA } { Y } " , f"{ BETA } { X } " , f"{ BETA } { Y } " ,
182- f"{ PHASE_ADV } { X } " , f"{ PHASE_ADV } { Y } " , "R11" , "R12" , "R21" , "R22" ],
183- headers = {f"{ TUNE } 1" : qx , f"{ TUNE } 2" : qy }
184- )
179+ df = tfs .TfsDataFrame (
180+ 0.0 ,
181+ index = [str (i ) for i in range (n )],
182+ columns = [S , f"{ ALPHA } { X } " , f"{ ALPHA } { Y } " , f"{ BETA } { X } " , f"{ BETA } { Y } " ,
183+ f"{ PHASE_ADV } { X } " , f"{ PHASE_ADV } { Y } " , "R11" , "R12" , "R21" , "R22" ],
184+ headers = {f"{ TUNE } 1" : qx , f"{ TUNE } 2" : qy },
185+ )
185186
186187 r = np .random .rand (n )
187188 df [S ] = np .linspace (0 , n , n )
@@ -211,4 +212,4 @@ def _coupling_bump_teapot_cta() -> float:
211212 df_twiss [F1001 ] = df_cmatrix [F1001 ] # ignoring F1010 in this test as it is bigger than F1001
212213
213214 cta_df = closest_tune_approach (df_twiss , method = "teapot" ) # only one column
214- return cta_df .mean ().abs ()[0 ] # this is the cminus
215+ return cta_df .mean ().abs (). iloc [0 ] # this is the cminus
0 commit comments