|
30 | 30 | 'path_ref': '../', |
31 | 31 | 'type_ref': 'sixtrack', |
32 | 32 | 'rtol': 4e-7, |
33 | | - 'atol': 1e-100, |
| 33 | + 'atol': 1e-13, |
34 | 34 | 'strict': True, |
35 | 35 | } |
36 | 36 | ] |
@@ -238,9 +238,13 @@ def prepare_line(path, input_type): |
238 | 238 | 'mcbch.5r2.b2', 'mcbch.a5r2.b2', 'mcbyh.4r2.b2', 'mcbxh.3r2', |
239 | 239 | 'mcbyh.a4l2.b2', 'mcbyh.5l2.b2', 'mcbyv.5r8.b2', 'mcbyv.a4r8.b2', |
240 | 240 | 'mcbxv.3r8', 'mcbyv.4l8.b2', 'mcbcv.b5l8.b2']: |
241 | | - if nn_corr in nn_test and diff_rel < 1e-2: |
242 | | - passed_corr = True |
243 | | - break |
| 241 | + if nn_corr in nn_test and kk in ['knl','ksl','bal']: |
| 242 | + assert len(val_ref)<=2 |
| 243 | + assert len(val_test)<=2 |
| 244 | + diff_rel = norm(val_test-val_ref)/norm(val_ref) |
| 245 | + passed_corr = (diff_rel < 1e-2) |
| 246 | + if passed_corr: |
| 247 | + break |
244 | 248 | if not(strict) and passed_corr: |
245 | 249 | continue |
246 | 250 |
|
@@ -285,7 +289,14 @@ def prepare_line(path, input_type): |
285 | 289 | if kk == "px_co" or kk == 'py_co': |
286 | 290 | if diff_abs <30e-9: |
287 | 291 | continue |
288 | | - |
| 292 | + if isinstance(ee_test, xt.XYShift): |
| 293 | + if kk in ['dx','dy']: |
| 294 | + if diff_abs <1e-9: |
| 295 | + continue |
| 296 | + if isinstance(ee_test, xt.SRotation): |
| 297 | + if kk in ['sin_z', 'cos_z', 'angle']: |
| 298 | + if diff_abs <1e-9: |
| 299 | + continue |
289 | 300 | # If it got here it means that no condition above is met |
290 | 301 | raise ValueError("Too large discrepancy!") |
291 | 302 | print( |
|
0 commit comments