@@ -487,7 +487,7 @@ def test_rigidity_knob_fails_on_invalid_ir(_non_matched_lhc_madx, caplog):
487487def test_rigidity_knob_fails_on_invalid_side (caplog , _non_matched_lhc_madx ):
488488 madx = _non_matched_lhc_madx
489489
490- with pytest .raises (ValueError , match = "Invalid value for parameter 'side'." ):
490+ with pytest .raises (ValueError , match = r "Invalid value for parameter 'side'." ):
491491 apply_lhc_rigidity_waist_shift_knob (madx , 1 , 1 , "invalid" )
492492
493493 for record in caplog .records :
@@ -712,10 +712,10 @@ def test_get_bpms_coupling_rdts(_non_matched_lhc_madx, _reference_twiss_rdts):
712712
713713 twiss_with_rdts = get_lhc_bpms_twiss_and_rdts (madx )
714714 # We separate the complex components to compare to the reference
715- twiss_with_rdts ["F1001R" ] = twiss_with_rdts .F1001 .apply (np .real )
716- twiss_with_rdts ["F1001I" ] = twiss_with_rdts .F1001 .apply (np .imag )
717- twiss_with_rdts ["F1010R" ] = twiss_with_rdts .F1010 .apply (np .real )
718- twiss_with_rdts ["F1010I" ] = twiss_with_rdts .F1010 .apply (np .imag )
715+ twiss_with_rdts ["F1001R" ] = twiss_with_rdts .F1001 .apply (np .real ) # ty:ignore[unresolved-attribute]
716+ twiss_with_rdts ["F1001I" ] = twiss_with_rdts .F1001 .apply (np .imag ) # ty:ignore[unresolved-attribute]
717+ twiss_with_rdts ["F1010R" ] = twiss_with_rdts .F1010 .apply (np .real ) # ty:ignore[unresolved-attribute]
718+ twiss_with_rdts ["F1010I" ] = twiss_with_rdts .F1010 .apply (np .imag ) # ty:ignore[unresolved-attribute]
719719 twiss_with_rdts = twiss_with_rdts .drop (columns = ["F1001" , "F1010" ]).set_index ("NAME" )
720720 # Only care to compare the coupling RDTs columns
721721 twiss_with_rdts = twiss_with_rdts .loc [:, ["F1001R" , "F1001I" , "F1010R" , "F1010I" ]]
@@ -727,8 +727,8 @@ def test_get_bpms_coupling_rdts(_non_matched_lhc_madx, _reference_twiss_rdts):
727727def test_k_modulation (_non_matched_lhc_madx , _reference_kmodulation ):
728728 madx = _non_matched_lhc_madx
729729 results = do_kmodulation (madx )
730- assert all (var == 0 for var in results . ERRTUNEX )
731- assert all (var == 0 for var in results . ERRTUNEY )
730+ assert np . all (results . ERRTUNEX . to_numpy () == 0 ) # ty:ignore[unresolved-attribute]
731+ assert np . all (results . ERRTUNEY . to_numpy () == 0 ) # ty:ignore[unresolved-attribute]
732732
733733 reference = tfs .read (_reference_kmodulation )
734734 assert_frame_equal (results .convert_dtypes (), reference .convert_dtypes ()) # avoid dtype comparison error on 0 cols
@@ -841,7 +841,7 @@ def test_lhc_run3_setup_context_manager_raises_on_wrong_b4_conditions():
841841@pytest .mark .skipif (not (TESTS_DIR .parent / "acc-models-lhc" ).is_dir (), reason = "acc-models-lhc not found" )
842842def test_lhc_run3_setup_context_manager_raises_on_wrong_run_value ():
843843 with pytest .raises ( # noqa: SIM117
844- NotImplementedError , match = "This setup is only possible for Run 2 and Run 3 configurations."
844+ NotImplementedError , match = r "This setup is only possible for Run 2 and Run 3 configurations."
845845 ): # using b4 with beam1 setup crashes
846846 with LHCSetup (run = 1 , opticsfile = "R2022a_A30cmC30cmA10mL200cm.madx" ) as madx : # noqa: F841
847847 pass
0 commit comments