Incompatabiliy of EX_02 with changes in numpy 2.0
Numpy 2.0 changed the default behaviour of loadtxt from passing bytes to passing strings, making the converter in https://gitlab.cern.ch/blond/BLonD/-/blob/master/__EXAMPLES/main_files/EX_02_Main_long_ps_booster.py?ref_type=heads#L105 crash.
The error occurs only in pipeline 3.10, as numpy 2.0 is not supported in Python 3.8.
The lines can be fixed with
Ekicker = np.loadtxt(this_directory + '../input_files/EX_02_Ekicker_1.4GeV.txt', skiprows=1, dtype=complex,
encoding="utf-8",
converters={0: lambda s: complex(bytes(s, encoding="utf-8").decode('UTF-8').replace('i', 'j')),
1: lambda y: complex(bytes(y, encoding="utf-8").decode('UTF-8').replace('i', 'j'))})
The changes of the encoding in bytes is necessary as the data gets passed by string instead of bytes, which requires an encoding definition. The change in encoding in loadtext is necessary as the defaults are different pre and post 2.0.
Edited by Leonard Sebastian Thiele