xtrack 0.94.0__tar.gz → 0.94.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. {xtrack-0.94.0/xtrack.egg-info → xtrack-0.94.2}/PKG-INFO +1 -1
  2. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_native_madloader_lhc.py +18 -14
  3. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_particles_basics.py +11 -0
  4. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/__init__.py +1 -1
  5. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/_temp/boris_and_solenoid_map/solenoid_field.py +3 -2
  6. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/_temp/python_lattice_writer/lattice_py_generation.py +19 -7
  7. xtrack-0.94.2/xtrack/_version.py +1 -0
  8. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/environment.py +2 -2
  9. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/mad_loader.py +3 -2
  10. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/mad_parser/loader.py +2 -2
  11. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/mad_writer.py +2 -0
  12. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/particles/particles.py +60 -34
  13. {xtrack-0.94.0 → xtrack-0.94.2/xtrack.egg-info}/PKG-INFO +1 -1
  14. xtrack-0.94.0/xtrack/_version.py +0 -1
  15. {xtrack-0.94.0 → xtrack-0.94.2}/LICENSE +0 -0
  16. {xtrack-0.94.0 → xtrack-0.94.2}/MANIFEST.in +0 -0
  17. {xtrack-0.94.0 → xtrack-0.94.2}/README.md +0 -0
  18. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/__init__.py +0 -0
  19. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/base_classes.py +0 -0
  20. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/be_beamfields/BB6D.py +0 -0
  21. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/be_beamfields/BB6Ddata.py +0 -0
  22. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/be_beamfields/__init__.py +0 -0
  23. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/be_beamfields/beambeam.py +0 -0
  24. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/be_beamfields/boost.py +0 -0
  25. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/be_beamfields/gaussian_fields.py +0 -0
  26. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/be_beamfields/propagate_sigma_matrix.py +0 -0
  27. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/be_beamfields/qgauss.py +0 -0
  28. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/be_beamfields/slicing.py +0 -0
  29. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/be_beamfields/spacecharge.py +0 -0
  30. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/elements.py +0 -0
  31. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/line.py +0 -0
  32. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/mathlibs.py +0 -0
  33. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/particles.py +0 -0
  34. {xtrack-0.94.0 → xtrack-0.94.2}/ducktrack/temp_pyparticles.py +0 -0
  35. {xtrack-0.94.0 → xtrack-0.94.2}/pyproject.toml +0 -0
  36. {xtrack-0.94.0 → xtrack-0.94.2}/setup.cfg +0 -0
  37. {xtrack-0.94.0 → xtrack-0.94.2}/setup.py +0 -0
  38. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_acceleration.py +0 -0
  39. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_amplitude_detuning.py +0 -0
  40. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_aperture_table.py +0 -0
  41. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_aperture_turn_ele_and_monitor.py +0 -0
  42. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_apertures.py +0 -0
  43. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_attr_replicas_and_slices.py +0 -0
  44. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_boris_spatial.py +0 -0
  45. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_bucket_with_ref_energy_change.py +0 -0
  46. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_cavity_absolute_time.py +0 -0
  47. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_chromatic_functions_vs_madx.py +0 -0
  48. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_coasting.py +0 -0
  49. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_collective_tracker.py +0 -0
  50. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_collimation.py +0 -0
  51. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_coupling_edwards_teng.py +0 -0
  52. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_electron_cooler.py +0 -0
  53. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_element_characterization_functions.py +0 -0
  54. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_element_internal_record.py +0 -0
  55. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_elements.py +0 -0
  56. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_elements_classflags.py +0 -0
  57. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_elements_thick.py +0 -0
  58. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_environment.py +0 -0
  59. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_fcc_ee_solenoid_correction.py +0 -0
  60. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_fcc_ee_solenoid_correction_new_optimize_api.py +0 -0
  61. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_footprint.py +0 -0
  62. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_freeze_longitudinal.py +0 -0
  63. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_full_rings.py +0 -0
  64. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_h6_sps_beamline.py +0 -0
  65. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_hvkick.py +0 -0
  66. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_ions.py +0 -0
  67. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_json.py +0 -0
  68. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_legacy_multiline_to_env.py +0 -0
  69. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_lhc_env.py +0 -0
  70. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_lhc_match_phase_15.py +0 -0
  71. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_line.py +0 -0
  72. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_load.py +0 -0
  73. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_load_vars.py +0 -0
  74. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_lumi.py +0 -0
  75. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_mad_writer.py +0 -0
  76. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_madloader.py +0 -0
  77. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_madnginterface.py +0 -0
  78. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_magnet.py +0 -0
  79. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_match_and_track_from_element.py +0 -0
  80. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_match_coupling_knob.py +0 -0
  81. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_match_nested.py +0 -0
  82. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_match_optics_and_ip_knob.py +0 -0
  83. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_match_optics_and_ip_knob_new_optimize_api.py +0 -0
  84. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_match_orbit_bump.py +0 -0
  85. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_match_tune_chroma_cminus.py +0 -0
  86. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_misalign.py +0 -0
  87. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_monitor.py +0 -0
  88. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_multi_bunch_gauss.py +0 -0
  89. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_multiline.py +0 -0
  90. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_multisetter.py +0 -0
  91. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_multispecies.py +0 -0
  92. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_native_madloader.py +0 -0
  93. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_optimize_for_tracking.py +0 -0
  94. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_particles.py +0 -0
  95. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_particles_pdg.py +0 -0
  96. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_pipeline.py +0 -0
  97. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_prebuild_kernels.py +0 -0
  98. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_ps_against_ptc.py +0 -0
  99. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_ps_multiturn_twiss.py +0 -0
  100. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_psb_chicane.py +0 -0
  101. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_pyht_interface.py +0 -0
  102. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_quadrupole_fringe_ptc.py +0 -0
  103. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_quadrupole_wedge.py +0 -0
  104. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_radial_steering.py +0 -0
  105. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_radiation.py +0 -0
  106. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_radiation_equilibrium_emittances.py +0 -0
  107. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_radiation_equilibrium_emittances_thick.py +0 -0
  108. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_radiation_integrals.py +0 -0
  109. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_random_gen.py +0 -0
  110. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_random_gen_exp.py +0 -0
  111. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_random_gen_gauss.py +0 -0
  112. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_random_gen_ruth.py +0 -0
  113. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_rbend_rbarc.py +0 -0
  114. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_rbend_straight_body.py +0 -0
  115. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_rf_track.py +0 -0
  116. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_rotation_signs.py +0 -0
  117. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_second_order_taylor_map.py +0 -0
  118. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_seeds.py +0 -0
  119. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_slice_and_insert_with_replicas.py +0 -0
  120. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_slice_elements.py +0 -0
  121. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_slicing.py +0 -0
  122. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_solenoid_bz_map_vs_boris.py +0 -0
  123. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_solenoid_bz_map_vs_boris_legacy.py +0 -0
  124. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_spacecharge_in_ring.py +0 -0
  125. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_spin.py +0 -0
  126. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_sps_thick.py +0 -0
  127. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_survey.py +0 -0
  128. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_tapering.py +0 -0
  129. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_thick_kickers_rf_crab.py +0 -0
  130. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_thick_lhc.py +0 -0
  131. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_tilt_shifts.py +0 -0
  132. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_tracker.py +0 -0
  133. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_trajectory_correcton.py +0 -0
  134. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_twiss.py +0 -0
  135. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_twiss_to_file.py +0 -0
  136. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_twiss_vs_madx_psb.py +0 -0
  137. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_vs_madx.py +0 -0
  138. {xtrack-0.94.0 → xtrack-0.94.2}/tests/test_xmask_orbit_correction.py +0 -0
  139. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/_temp/__init__.py +0 -0
  140. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/_temp/boris_and_solenoid_map/__init__.py +0 -0
  141. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/_temp/boris_and_solenoid_map/boris.h +0 -0
  142. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/_temp/lhc_match/__init__.py +0 -0
  143. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/_temp/lhc_match/gen_madx_optics_file.py +0 -0
  144. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/_temp/lhc_match/lhc_match.py +0 -0
  145. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/_temp/lhc_match/var_limits.py +0 -0
  146. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/_temp/python_lattice_writer/__init__.py +0 -0
  147. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/aperture_meas.py +0 -0
  148. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/base_element.py +0 -0
  149. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/__init__.py +0 -0
  150. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/apertures.py +0 -0
  151. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/apertures_src/limitellipse.h +0 -0
  152. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/apertures_src/limitpolygon.h +0 -0
  153. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/apertures_src/limitracetrack.h +0 -0
  154. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/apertures_src/limitrect.h +0 -0
  155. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/apertures_src/limitrectellipse.h +0 -0
  156. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/apertures_src/longitudinallimitrect.h +0 -0
  157. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/beam_interaction.py +0 -0
  158. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements.py +0 -0
  159. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/bend.h +0 -0
  160. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/cavity.h +0 -0
  161. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/crab_cavity.h +0 -0
  162. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/default_magnet_config.h +0 -0
  163. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/dipole_fringe.h +0 -0
  164. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/dipoleedge.h +0 -0
  165. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift.h +0 -0
  166. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift_exact.h +0 -0
  167. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift_exact_slice.h +0 -0
  168. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift_slice.h +0 -0
  169. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift_slice_bend.h +0 -0
  170. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift_slice_cavity.h +0 -0
  171. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift_slice_crab_cavity.h +0 -0
  172. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift_slice_multipole.h +0 -0
  173. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift_slice_octupole.h +0 -0
  174. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift_slice_quadrupole.h +0 -0
  175. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift_slice_rbend.h +0 -0
  176. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift_slice_sextupole.h +0 -0
  177. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/drift_slice_uniform_solenoid.h +0 -0
  178. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/electroncooler.h +0 -0
  179. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/elens.h +0 -0
  180. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/exciter.h +0 -0
  181. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/firstordertaylormap.h +0 -0
  182. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/legacy_solenoid.h +0 -0
  183. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/linesegmentmap.h +0 -0
  184. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/magnet.h +0 -0
  185. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/magnet_drift.h +0 -0
  186. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/magnet_edge.h +0 -0
  187. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/magnet_kick.h +0 -0
  188. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/marker.h +0 -0
  189. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/misalignment.h +0 -0
  190. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/multipole.h +0 -0
  191. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/multipoleedge.h +0 -0
  192. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/nonlinearlens.h +0 -0
  193. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/octupole.h +0 -0
  194. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/quadrupole.h +0 -0
  195. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/rbend.h +0 -0
  196. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/referenceenergyincrease.h +0 -0
  197. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/rfmultipole.h +0 -0
  198. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/second_order_taylor_map.h +0 -0
  199. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/sextupole.h +0 -0
  200. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/simplethinbend.h +0 -0
  201. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/simplethinquadrupole.h +0 -0
  202. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/slnd.h +0 -0
  203. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/srotation.h +0 -0
  204. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/temprf.h +0 -0
  205. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thick_slice_bend.h +0 -0
  206. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thick_slice_cavity.h +0 -0
  207. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thick_slice_crab_cavity.h +0 -0
  208. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thick_slice_multipole.h +0 -0
  209. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thick_slice_octupole.h +0 -0
  210. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thick_slice_quadrupole.h +0 -0
  211. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thick_slice_rbend.h +0 -0
  212. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thick_slice_sextupole.h +0 -0
  213. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thick_slice_uniform_solenoid.h +0 -0
  214. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_bend.h +0 -0
  215. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_bend_entry.h +0 -0
  216. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_bend_exit.h +0 -0
  217. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_cavity.h +0 -0
  218. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_crab_cavity.h +0 -0
  219. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_multipole.h +0 -0
  220. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_octupole.h +0 -0
  221. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_octupole_entry.h +0 -0
  222. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_octupole_exit.h +0 -0
  223. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_quadrupole.h +0 -0
  224. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_quadrupole_entry.h +0 -0
  225. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_quadrupole_exit.h +0 -0
  226. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_rbend.h +0 -0
  227. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_rbend_entry.h +0 -0
  228. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_rbend_exit.h +0 -0
  229. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_sextupole.h +0 -0
  230. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_sextupole_entry.h +0 -0
  231. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_sextupole_exit.h +0 -0
  232. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_uniform_solenoid_entry.h +0 -0
  233. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/thin_slice_uniform_solenoid_exit.h +0 -0
  234. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_dipole_edge_linear.h +0 -0
  235. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_dipole_edge_nonlinear.h +0 -0
  236. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_dipole_fringe.h +0 -0
  237. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_drift.h +0 -0
  238. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_legacy_solenoid.h +0 -0
  239. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_legacy_solenoid_multipolar_components.h +0 -0
  240. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_legacy_solenoid_radiation.h +0 -0
  241. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_magnet.h +0 -0
  242. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_magnet.template.h +0 -0
  243. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_magnet_configure.h +0 -0
  244. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_magnet_drift.h +0 -0
  245. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_magnet_edge.h +0 -0
  246. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_magnet_kick.h +0 -0
  247. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_magnet_radiation.h +0 -0
  248. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_misalignments.h +0 -0
  249. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_mult_fringe.h +0 -0
  250. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_rf.h +0 -0
  251. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_rf.template.h +0 -0
  252. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_srotation.h +0 -0
  253. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_thick_bend.h +0 -0
  254. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_thick_cfd.h +0 -0
  255. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_wedge.h +0 -0
  256. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_xrotation.h +0 -0
  257. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_xyshift.h +0 -0
  258. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/track_yrotation.h +0 -0
  259. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/variable_solenoid.h +0 -0
  260. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/wedge.h +0 -0
  261. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/wire.h +0 -0
  262. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/xrotation.h +0 -0
  263. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/xyshift.h +0 -0
  264. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/yrotation.h +0 -0
  265. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/elements_src/zetashift.h +0 -0
  266. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/exciter.py +0 -0
  267. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/rft_element.py +0 -0
  268. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/slice_base.py +0 -0
  269. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/slice_elements_drift.py +0 -0
  270. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/slice_elements_edge.py +0 -0
  271. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/slice_elements_thick.py +0 -0
  272. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/beam_elements/slice_elements_thin.py +0 -0
  273. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/boris.py +0 -0
  274. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/builder.py +0 -0
  275. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/footprint.py +0 -0
  276. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/functions.py +0 -0
  277. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/general.py +0 -0
  278. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/headers/atomicadd.h +0 -0
  279. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/headers/checks.h +0 -0
  280. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/headers/constants.h +0 -0
  281. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/headers/particle_states.h +0 -0
  282. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/headers/synrad_spectrum.h +0 -0
  283. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/headers/track.h +0 -0
  284. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/internal_record.py +0 -0
  285. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/json.py +0 -0
  286. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/line.py +0 -0
  287. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/linear_normal_form.py +0 -0
  288. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/load.py +0 -0
  289. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/loss_location_refinement/__init__.py +0 -0
  290. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/loss_location_refinement/loss_location_refinement.py +0 -0
  291. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/lumi.py +0 -0
  292. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/mad_parser/__init__.py +0 -0
  293. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/mad_parser/madx.lark +0 -0
  294. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/mad_parser/parse.py +0 -0
  295. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/madng_interface.py +0 -0
  296. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/match.py +0 -0
  297. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/monitors/__init__.py +0 -0
  298. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/monitors/beam_position_monitor.h +0 -0
  299. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/monitors/beam_position_monitor.py +0 -0
  300. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/monitors/beam_profile_monitor.h +0 -0
  301. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/monitors/beam_profile_monitor.py +0 -0
  302. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/monitors/beam_size_monitor.h +0 -0
  303. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/monitors/beam_size_monitor.py +0 -0
  304. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/monitors/last_turns_monitor.h +0 -0
  305. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/monitors/last_turns_monitor.py +0 -0
  306. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/monitors/particles_monitor.h +0 -0
  307. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/monitors/particles_monitor.py +0 -0
  308. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/multiline.py +0 -0
  309. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/multiline_legacy/__init__.py +0 -0
  310. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/multiline_legacy/multiline_legacy.py +0 -0
  311. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/multiline_legacy/shared_knobs.py +0 -0
  312. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/multisetter/__init__.py +0 -0
  313. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/multisetter/multisetter.py +0 -0
  314. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/particles/__init__.py +0 -0
  315. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/particles/constants.py +0 -0
  316. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/particles/masses.py +0 -0
  317. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/particles/pdg.py +0 -0
  318. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/particles/rng_src/base_rng.h +0 -0
  319. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/particles/rng_src/particles_rng.h +0 -0
  320. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/pipeline/__init__.py +0 -0
  321. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/pipeline/core.py +0 -0
  322. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/pipeline/manager.py +0 -0
  323. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/pipeline/multitracker.py +0 -0
  324. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/prebuilt_kernel_definitions/__init__.py +0 -0
  325. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/prebuilt_kernel_definitions/element_inits.py +0 -0
  326. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/prebuilt_kernel_definitions/element_types.py +0 -0
  327. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/progress_indicator.py +0 -0
  328. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/random/__init__.py +0 -0
  329. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/random/random_generators.py +0 -0
  330. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/random/random_src/exponential.h +0 -0
  331. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/random/random_src/exponential_integral_Ei.h +0 -0
  332. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/random/random_src/normal.h +0 -0
  333. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/random/random_src/rutherford.h +0 -0
  334. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/random/random_src/uniform.h +0 -0
  335. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/random/random_src/uniform_accurate.h +0 -0
  336. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/slicing.py +0 -0
  337. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/survey.py +0 -0
  338. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/svgutils/__init__.py +0 -0
  339. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/svgutils/parser.py +0 -0
  340. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/svgutils/path.py +0 -0
  341. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/svgutils/svgutils.py +0 -0
  342. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/synctime.py +0 -0
  343. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/table.py +0 -0
  344. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/tapering.py +0 -0
  345. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/targets.py +0 -0
  346. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/track_flags.py +0 -0
  347. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/tracker.py +0 -0
  348. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/tracker_data.py +0 -0
  349. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/tracker_src/tracker.h +0 -0
  350. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/trajectory_correction.py +0 -0
  351. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/twiss.py +0 -0
  352. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/twissplot.py +0 -0
  353. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack/view.py +0 -0
  354. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack.egg-info/SOURCES.txt +0 -0
  355. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack.egg-info/dependency_links.txt +0 -0
  356. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack.egg-info/requires.txt +0 -0
  357. {xtrack-0.94.0 → xtrack-0.94.2}/xtrack.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xtrack
3
- Version: 0.94.0
3
+ Version: 0.94.2
4
4
  Summary: Tracking library for particle accelerators
5
5
  Home-page: https://xsuite.readthedocs.io/
6
6
  Download-URL: https://pypi.python.org/pypi/xtrack
@@ -109,6 +109,10 @@ def test_native_loader_lhc(line_mode, data_mode, tmpdir, lines_ref):
109
109
  elif data_mode == 'copy':
110
110
  env = env.copy()
111
111
  elif data_mode == 'py':
112
+ # Force k0_from_h to False (they are all provided)
113
+ for nn in list(env.elements.keys()):
114
+ if hasattr(env.elements[nn], 'k0_from_h'):
115
+ env.elements[nn].k0_from_h = False
112
116
  lpg.write_py_lattice_file(env,
113
117
  output_fname=tmpdir / f'lhc_{line_mode}.py')
114
118
  env = xt.Environment()
@@ -381,18 +385,18 @@ def test_native_loader_lhc(line_mode, data_mode, tmpdir, lines_ref):
381
385
  if nn == '_end_point':
382
386
  continue
383
387
  nn_straight = nn[:-len(f'/lhcb{beam}')] if nn.endswith(f'/lhcb{beam}') else nn
384
- e2 = lref[nn_straight]
385
- e4 = ltest[nn]
386
- d2 = e2.to_dict()
387
- d4 = e4.to_dict()
388
- is_rbend = isinstance(e4, xt.RBend)
388
+ eref = lref[nn_straight]
389
+ etest = ltest[nn]
390
+ dref = eref.to_dict()
391
+ dtest = etest.to_dict()
392
+ is_rbend = isinstance(etest, xt.RBend)
389
393
 
390
- for kk in d2.keys():
394
+ for kk in dref.keys():
391
395
  if kk in ('__class__', 'model', 'side'):
392
- assert d2[kk] == d4[kk]
396
+ assert dref[kk] == dtest[kk]
393
397
  continue
394
398
 
395
- if kk == '_isthick' and e2.length == 0:
399
+ if kk == '_isthick' and eref.length == 0:
396
400
  continue # Skip the check for zero-length elements
397
401
 
398
402
  if kk in {
@@ -403,21 +407,21 @@ def test_native_loader_lhc(line_mode, data_mode, tmpdir, lines_ref):
403
407
  continue
404
408
 
405
409
  if kk in {'knl', 'ksl'}:
406
- maxlen = max(len(d2[kk]), len(d4[kk]))
407
- lhs = np.pad(d2[kk], (0, maxlen - len(d2[kk])), mode='constant')
408
- rhs = np.pad(d4[kk], (0, maxlen - len(d4[kk])), mode='constant')
410
+ maxlen = max(len(dref[kk]), len(dtest[kk]))
411
+ lhs = np.pad(dref[kk], (0, maxlen - len(dref[kk])), mode='constant')
412
+ rhs = np.pad(dtest[kk], (0, maxlen - len(dtest[kk])), mode='constant')
409
413
  xo.assert_allclose(lhs, rhs, rtol=1e-10, atol=1e-16)
410
414
  continue
411
415
 
412
416
  if is_rbend and kk in ('length', 'length_straight'):
413
- xo.assert_allclose(d2[kk], d4[kk], rtol=1e-7, atol=1e-6)
417
+ xo.assert_allclose(dref[kk], dtest[kk], rtol=1e-7, atol=1e-6)
414
418
  continue
415
419
 
416
420
  if is_rbend and kk in ('h', 'k0'):
417
- xo.assert_allclose(d2[kk], d4[kk], rtol=1e-7, atol=5e-10)
421
+ xo.assert_allclose(dref[kk], dtest[kk], rtol=1e-7, atol=5e-10)
418
422
  continue
419
423
 
420
- xo.assert_allclose(d2[kk], d4[kk], rtol=1e-10, atol=1e-16)
424
+ xo.assert_allclose(dref[kk], dtest[kk], rtol=1e-10, atol=1e-16)
421
425
 
422
426
  twref = lref.twiss4d()
423
427
  twtest = ltest.twiss4d()
@@ -697,3 +697,14 @@ def test_LocalParticle_angles(test_context):
697
697
  particles.move(_context=xo.ContextCpu())
698
698
  xo.assert_allclose(particles.px, [23.99302e-3, 18.01805e-3], atol=1e-14, rtol=5e-7)
699
699
  xo.assert_allclose(particles.py, [-1.81976e-3, -4.73529e-3], atol=1e-14, rtol=5e-7)
700
+
701
+
702
+ @for_all_test_contexts
703
+ def test_update_rigidity0(test_context):
704
+ p = xt.Particles("proton",p0c=7000e9)
705
+ pb82 = xt.Particles("Pb208",q0=82,rigidity0=p.rigidity0)
706
+ assert np.allclose(pb82.p0c/82,p.p0c)
707
+ pb82.rigidity0=p.rigidity0
708
+ assert np.allclose(pb82.p0c/82,p.p0c)
709
+
710
+
@@ -6,7 +6,7 @@
6
6
  from .general import _pkg_root, _print, START, END
7
7
 
8
8
  from .particles import (Particles, PROTON_MASS_EV, ELECTRON_MASS_EV,
9
- enable_pyheadtail_interface, disable_pyheadtail_interface)
9
+ enable_pyheadtail_interface, disable_pyheadtail_interface, masses)
10
10
 
11
11
  from .base_element import BeamElement, Replica
12
12
  from .beam_elements import *
@@ -1,7 +1,8 @@
1
1
  import numpy as np
2
2
  import scipy
3
-
4
- # https://par.nsf.gov/servlets/purl/10220882
3
+ # Hampton et al., Closed-form expressions for the magnetic fields of rectangular
4
+ # and circular finite-length solenoids and current loops
5
+ # https://pubs.aip.org/aip/adv/article/10/6/065320/997382/
5
6
 
6
7
  def ellipp(n, m):
7
8
  """
@@ -6,7 +6,7 @@ from xtrack.mad_parser.loader import CONSTANTS
6
6
 
7
7
  formatter = xd.refs.CompactFormatter(scope=None)
8
8
  SKIP_PARAMS = ['order', 'model', '_edge_entry_model', '_edge_exit_model',
9
- 'k0_from_h', 'h']
9
+ 'h']
10
10
 
11
11
 
12
12
  def _repr_arr_ref(arr_ref, formatter):
@@ -36,15 +36,17 @@ def _elem_to_tokens(env, nn, formatter):
36
36
  if hasattr(ee, 'ksl'):
37
37
  fields += ['ksl']
38
38
 
39
- if isinstance(ee, xt.RBend):
40
- assert 'length_straight' in fields
41
- fields = [ff for ff in fields if ff != 'length']
42
-
43
39
  tt = env[nn].get_table()
44
40
  for kk in tt.name:
41
+ if kk in fields:
42
+ continue
45
43
  if tt['expr', kk] is not None and tt['expr', kk] != 'None':
46
44
  fields.append(kk)
47
45
 
46
+ if isinstance(ee, xt.RBend):
47
+ assert 'length_straight' in fields
48
+ fields = [ff for ff in fields if ff != 'length']
49
+
48
50
  params = []
49
51
  for kk in fields:
50
52
  if kk == '__class__':
@@ -55,6 +57,8 @@ def _elem_to_tokens(env, nn, formatter):
55
57
  continue
56
58
  if kk == 'prototype':
57
59
  continue
60
+ if kk == 'k0_from_h' and not ee.k0_from_h:
61
+ continue
58
62
  if kk == 'knl' or kk == 'ksl':
59
63
  arr_ref = getattr(ee_ref, kk)
60
64
  vv = _repr_arr_ref(arr_ref, formatter)
@@ -84,6 +88,13 @@ def _elem_to_tokens(env, nn, formatter):
84
88
 
85
89
  def write_py_lattice_file(env, output_fname):
86
90
 
91
+ file_content = gen_py_lattice(env)
92
+
93
+ with open(output_fname, 'w') as ff:
94
+ ff.write(file_content)
95
+
96
+ def gen_py_lattice(env):
97
+
87
98
  ###################
88
99
  # Handle elements #
89
100
  ###################
@@ -301,5 +312,6 @@ def write_py_lattice_file(env, output_fname):
301
312
  builder_part,
302
313
  postamble])
303
314
 
304
- with open(output_fname, 'w') as ff:
305
- ff.write(file_content)
315
+ return file_content
316
+
317
+
@@ -0,0 +1 @@
1
+ __version__ = '0.94.2'
@@ -1861,8 +1861,7 @@ class EnvParticleRef:
1861
1861
 
1862
1862
  def copy(self, **kwargs):
1863
1863
  return self._resolved.copy(**kwargs)
1864
-
1865
-
1864
+
1866
1865
  class EnvVars:
1867
1866
 
1868
1867
  def __init__(self, env):
@@ -2200,3 +2199,4 @@ def _disable_name_clash_checks(env):
2200
2199
  yield
2201
2200
  finally:
2202
2201
  env._enable_name_clash_check = old_value
2202
+
@@ -810,8 +810,8 @@ class MadLoader:
810
810
 
811
811
  if self.enable_field_errors:
812
812
  kwargs = _prepare_field_errors_thick_elem(mad_el)
813
- knl = kwargs['knl']
814
- ksl = kwargs['ksl']
813
+ knl = kwargs.get('knl', [0, 0, 0])
814
+ ksl = kwargs.get('ksl', [0, 0, 0])
815
815
  num_multipole_kicks = 1
816
816
  else:
817
817
  knl = [0] * 3
@@ -988,6 +988,7 @@ class MadLoader:
988
988
  convert_vmonitor = convert_drift_like
989
989
  convert_collimator = convert_drift_like
990
990
  convert_rcollimator = convert_drift_like
991
+ convert_ecollimator = convert_drift_like
991
992
  convert_elseparator = convert_drift_like
992
993
  convert_instrument = convert_drift_like
993
994
 
@@ -413,8 +413,8 @@ class MadxLoader:
413
413
  if 'length' in params:
414
414
  params['length_straight'] = params.pop('length')
415
415
 
416
- # Default MAD-X behaviour is to take k0 from h only if k0 is not
417
- # given. We need to replicate this behaviour. Ideally we should
416
+ # Default MAD-X behaviour is to take k0 from h only if k0 is zero.
417
+ # We need to replicate this behaviour. Ideally we should
418
418
  # evaluate expressions here, but that's tricky.
419
419
  if self._parameter_cache[name].get('k0', 0) == 0:
420
420
  params['k0_from_h'] = True
@@ -565,6 +565,8 @@ def element_to_mad_str(
565
565
  tokens = xsuite_to_mad_converters[el._parent.__class__](eref, mad_type=mad_type, substituted_vars=substituted_vars)
566
566
  if isinstance(el, xt.beam_elements.slice_elements_edge._ThinSliceEdgeBase):
567
567
  tokens.append(mad_assignment('kill_body', True, mad_type, substituted_vars=substituted_vars))
568
+ else:
569
+ raise NotImplementedError(f"Element of type {el.__class__} not supported yet in MAD writer")
568
570
  else:
569
571
  tokens = xsuite_to_mad_converters[el.__class__](eref, mad_type=mad_type, substituted_vars=substituted_vars)
570
572
 
@@ -179,6 +179,10 @@ class Particles(xo.HybridClass):
179
179
  Reference relativistic gamma
180
180
  beta0 : array_like of float, optional
181
181
  Reference relativistic beta
182
+ rigidity0 : array_like of float, optional
183
+ Reference magnetic rigidity [T.m]
184
+ kinetic_energy0 : array_like of float, optional
185
+ Reference kinetic energy [eV]
182
186
  mass_ratio : array_like of float, optional
183
187
  mass/mass0 (this is used to track particles of
184
188
  different species. Note that mass is the rest mass
@@ -224,7 +228,7 @@ class Particles(xo.HybridClass):
224
228
 
225
229
  accepted_args = set(self._xofields.keys()) | {
226
230
  'energy0', 'tau', 'pzeta', 'mass_ratio', 'mass', 'kinetic_energy0',
227
- '_context', '_buffer', '_offset', 'p0', 'name',
231
+ '_context', '_buffer', '_offset', 'name', 'rigidity0',
228
232
  }
229
233
  if set(kwargs.keys()) - accepted_args:
230
234
  raise NameError(f'Invalid argument(s) provided: '
@@ -236,6 +240,8 @@ class Particles(xo.HybridClass):
236
240
  per_part_input_vars = (
237
241
  self.per_particle_vars +
238
242
  ((xo.Float64, 'energy0'),
243
+ (xo.Float64, 'kinetic_energy0'),
244
+ (xo.Float64, 'rigidity0'),
239
245
  (xo.Float64, 'tau'),
240
246
  (xo.Float64, 'pzeta'),
241
247
  (xo.Float64, 'mass_ratio'))
@@ -322,11 +328,6 @@ class Particles(xo.HybridClass):
322
328
  self.start_tracking_at_element = kwargs.get(
323
329
  'start_tracking_at_element', -1)
324
330
 
325
- # Init refs
326
- if 'kinetic_energy0' in kwargs.keys():
327
- assert kwargs.get('energy0') is None
328
- kwargs['energy0'] = kwargs.pop('kinetic_energy0') + self.mass0
329
-
330
331
  # Ensure that all per particle inputs are numpy arrays of the same
331
332
  # length, and move them to the target context
332
333
  for xotype, field in per_part_input_vars:
@@ -351,20 +352,22 @@ class Particles(xo.HybridClass):
351
352
  # Init independent per particle vars
352
353
  self.init_independent_per_part_vars(kwargs)
353
354
 
355
+ # Init chi and charge ratio
356
+ self._update_chi_charge_ratio(
357
+ chi=kwargs.get('chi'),
358
+ charge_ratio=kwargs.get('charge_ratio'),
359
+ mass_ratio=kwargs.get('mass_ratio'),
360
+ mask=input_mask,
361
+ )
354
362
 
363
+ # Init reference momentum and related vars
355
364
  self._update_refs(
356
365
  p0c=kwargs.get('p0c'),
357
366
  energy0=kwargs.get('energy0'),
358
367
  gamma0=kwargs.get('gamma0'),
359
368
  beta0=kwargs.get('beta0'),
360
- mask=input_mask,
361
- )
362
-
363
- # Init chi and charge ratio
364
- self._update_chi_charge_ratio(
365
- chi=kwargs.get('chi'),
366
- charge_ratio=kwargs.get('charge_ratio'),
367
- mass_ratio=kwargs.get('mass_ratio'),
369
+ kinetic_energy0=kwargs.get('kinetic_energy0'),
370
+ rigidity0=kwargs.get('rigidity0'),
368
371
  mask=input_mask,
369
372
  )
370
373
 
@@ -1235,13 +1238,25 @@ class Particles(xo.HybridClass):
1235
1238
  def p0c(self, value):
1236
1239
  self.p0c[:] = value
1237
1240
 
1241
+ def _rigidity0_setitem(self, indx, val):
1242
+ ctx = self._buffer.context
1243
+ temp_rigidity0 = ctx.zeros(shape=self._p0c.shape, dtype=np.float64)
1244
+ temp_rigidity0[:] = np.nan
1245
+ temp_rigidity0[indx] = val
1246
+ self.update_p0c(temp_rigidity0 * clight * self.q0)
1247
+
1238
1248
  @property
1239
1249
  def rigidity0(self):
1240
1250
  rigidity0 = self.p0c / clight / self.q0
1241
1251
  return self._buffer.context.linked_array_type.from_array(
1242
1252
  rigidity0,
1243
- mode='readonly',
1244
- container=self)
1253
+ mode='setitem_from_container',
1254
+ container=self,
1255
+ container_setitem_name='_rigidity0_setitem')
1256
+
1257
+ @rigidity0.setter
1258
+ def rigidity0(self, value):
1259
+ self.rigidity0[:] = value
1245
1260
 
1246
1261
  def update_gamma0(self, new_gamma0):
1247
1262
 
@@ -1277,7 +1292,6 @@ class Particles(xo.HybridClass):
1277
1292
  def gamma0(self, value):
1278
1293
  self.gamma0[:] = value
1279
1294
 
1280
-
1281
1295
 
1282
1296
  def update_beta0(self, new_beta0):
1283
1297
 
@@ -1528,13 +1542,13 @@ class Particles(xo.HybridClass):
1528
1542
  src_lines.append('if (set_scalar){')
1529
1543
  for _, vv in cls.size_vars + cls.scalar_vars:
1530
1544
  src_lines.append(
1531
- f' ParticlesData_set_' + vv + '(dest,'
1545
+ ' ParticlesData_set_' + vv + '(dest,'
1532
1546
  f' LocalParticle_get_{vv}(source));')
1533
1547
  src_lines.append('}')
1534
1548
 
1535
1549
  for _, vv in cls.per_particle_vars:
1536
1550
  src_lines.append(
1537
- f' ParticlesData_set_' + vv + '(dest, id, '
1551
+ ' ParticlesData_set_' + vv + '(dest, id, '
1538
1552
  f' LocalParticle_get_{vv}(source));')
1539
1553
  src_lines.append('}')
1540
1554
  src_local_to_particles = '\n'.join(src_lines)
@@ -1584,7 +1598,7 @@ class Particles(xo.HybridClass):
1584
1598
  for tt, vv in cls.size_vars + cls.scalar_vars:
1585
1599
  src_lines.append('/*gpufun*/')
1586
1600
  src_lines.append(f'{tt._c_type} LocalParticle_get_' + vv
1587
- + f'(LocalParticle* part)'
1601
+ + '(LocalParticle* part)'
1588
1602
  + '{')
1589
1603
  src_lines.append(f' return part->{vv};')
1590
1604
  src_lines.append('}')
@@ -1592,7 +1606,7 @@ class Particles(xo.HybridClass):
1592
1606
  for tt, vv in cls.per_particle_vars:
1593
1607
  src_lines.append('/*gpufun*/')
1594
1608
  src_lines.append(f'{tt._c_type} LocalParticle_get_' + vv
1595
- + f'(LocalParticle* part)'
1609
+ + '(LocalParticle* part)'
1596
1610
  + '{')
1597
1611
  src_lines.append(f' return part->{vv}[part->ipart];')
1598
1612
  src_lines.append('}')
@@ -1610,12 +1624,12 @@ class Particles(xo.HybridClass):
1610
1624
  src_angles_lines.append(f' double const p{xx} = LocalParticle_get_p{xx}(part);')
1611
1625
  if exact == 'exact_':
1612
1626
  src_angles_lines.append(f' double const p{yy} = LocalParticle_get_p{yy}(part);')
1613
- src_angles_lines.append(f' double const one_plus_delta = 1. + LocalParticle_get_delta(part);')
1627
+ src_angles_lines.append(' double const one_plus_delta = 1. + LocalParticle_get_delta(part);')
1614
1628
  src_angles_lines.append(
1615
- f' double const rpp = 1./sqrt(one_plus_delta*one_plus_delta - px*px - py*py);')
1629
+ ' double const rpp = 1./sqrt(one_plus_delta*one_plus_delta - px*px - py*py);')
1616
1630
  else:
1617
- src_angles_lines.append(f' double const rpp = LocalParticle_get_rpp(part);')
1618
- src_angles_lines.append(f' // INFO: this is not the angle, but sin(angle)')
1631
+ src_angles_lines.append(' double const rpp = LocalParticle_get_rpp(part);')
1632
+ src_angles_lines.append(' // INFO: this is not the angle, but sin(angle)')
1619
1633
  src_angles_lines.append(f' return p{xx}*rpp;')
1620
1634
  src_angles_lines.append('}')
1621
1635
  src_angles_lines.append('')
@@ -1625,15 +1639,15 @@ class Particles(xo.HybridClass):
1625
1639
  src_angles_lines.append('/*gpufun*/')
1626
1640
  src_angles_lines.append(f'void LocalParticle_set_{exact}{xx}p(LocalParticle* part, double {xx}p){{')
1627
1641
  src_angles_lines.append(f'#ifndef FREEZE_VAR_p{xx}')
1628
- src_angles_lines.append(f' double rpp = LocalParticle_get_rpp(part);')
1642
+ src_angles_lines.append(' double rpp = LocalParticle_get_rpp(part);')
1629
1643
  if exact == 'exact_':
1630
1644
  src_angles_lines.append(
1631
1645
  f' // Careful! If {yy}p also changes, use LocalParticle_set_{exact}xp_yp!')
1632
1646
  src_angles_lines.append(f' double const {yy}p = LocalParticle_get_{exact}{yy}p(part);')
1633
- src_angles_lines.append(f' rpp *= sqrt(1 + xp*xp + yp*yp);')
1647
+ src_angles_lines.append(' rpp *= sqrt(1 + xp*xp + yp*yp);')
1634
1648
  src_angles_lines.append(f' // INFO: {xx}p is not the angle, but sin(angle)')
1635
1649
  src_angles_lines.append(f' LocalParticle_set_p{xx}(part, {xx}p/rpp);')
1636
- src_angles_lines.append(f'#endif')
1650
+ src_angles_lines.append('#endif')
1637
1651
  src_angles_lines.append('}')
1638
1652
  src_angles_lines.append('')
1639
1653
 
@@ -1644,7 +1658,7 @@ class Particles(xo.HybridClass):
1644
1658
  src_angles_lines.append(f'#ifndef FREEZE_VAR_p{xx}')
1645
1659
  src_angles_lines.append(f' LocalParticle_set_{exact}{xx}p(part, '
1646
1660
  + f'LocalParticle_get_{exact}{xx}p(part) + {xx}p);')
1647
- src_angles_lines.append(f'#endif')
1661
+ src_angles_lines.append('#endif')
1648
1662
  src_angles_lines.append('}')
1649
1663
  src_angles_lines.append('')
1650
1664
  # Scaler
@@ -1653,19 +1667,19 @@ class Particles(xo.HybridClass):
1653
1667
  src_angles_lines.append(f'#ifndef FREEZE_VAR_p{xx}')
1654
1668
  src_angles_lines.append(f' LocalParticle_set_{exact}{xx}p(part, '
1655
1669
  + f'LocalParticle_get_{exact}{xx}p(part) * value);')
1656
- src_angles_lines.append(f'#endif')
1670
+ src_angles_lines.append('#endif')
1657
1671
  src_angles_lines.append('}')
1658
1672
  src_angles_lines.append('')
1659
1673
  # Double setter, adder, scaler
1660
1674
  src_angles_lines.append('/*gpufun*/')
1661
1675
  src_angles_lines.append(f'void LocalParticle_set_{exact}xp_yp(LocalParticle* part, double xp, double yp){{')
1662
- src_angles_lines.append(f' double rpp = LocalParticle_get_rpp(part);')
1676
+ src_angles_lines.append(' double rpp = LocalParticle_get_rpp(part);')
1663
1677
  if exact == 'exact_':
1664
- src_angles_lines.append(f' rpp *= sqrt(1 + xp*xp + yp*yp);')
1678
+ src_angles_lines.append(' rpp *= sqrt(1 + xp*xp + yp*yp);')
1665
1679
  for xx in ['x', 'y']:
1666
1680
  src_angles_lines.append(f'#ifndef FREEZE_VAR_p{xx}')
1667
1681
  src_angles_lines.append(f' LocalParticle_set_p{xx}(part, {xx}p/rpp);')
1668
- src_angles_lines.append(f'#endif')
1682
+ src_angles_lines.append('#endif')
1669
1683
  src_angles_lines.append('}')
1670
1684
  src_angles_lines.append('')
1671
1685
  src_angles_lines.append('/*gpufun*/')
@@ -2099,8 +2113,10 @@ class Particles(xo.HybridClass):
2099
2113
  getattr(self, varname)[mask] = target_val[mask]
2100
2114
 
2101
2115
  def _update_refs(self, p0c=None, energy0=None, gamma0=None, beta0=None,
2116
+ kinetic_energy0=None, rigidity0=None,
2102
2117
  mask=None):
2103
- if not any(ff is not None for ff in (p0c, energy0, gamma0, beta0)):
2118
+ if not any(ff is not None for ff in (p0c, energy0, gamma0, beta0,
2119
+ kinetic_energy0, rigidity0)):
2104
2120
  self._p0c = 1e9
2105
2121
  p0c = self._p0c
2106
2122
 
@@ -2125,6 +2141,16 @@ class Particles(xo.HybridClass):
2125
2141
  _energy0 = self.mass0 * _gamma0
2126
2142
  _p0c = _energy0 * beta0
2127
2143
  _beta0 = beta0
2144
+ elif kinetic_energy0 is not None:
2145
+ _energy0 = kinetic_energy0 + self.mass0
2146
+ _p0c = _sqrt(_energy0 ** 2 - self.mass0 ** 2)
2147
+ _beta0 = _p0c / _energy0
2148
+ _gamma0 = _energy0 / self.mass0
2149
+ elif rigidity0 is not None:
2150
+ _p0c = rigidity0 * abs(self.q0) * clight
2151
+ _energy0 = _sqrt(_p0c ** 2 + self.mass0 ** 2)
2152
+ _beta0 = _p0c / _energy0
2153
+ _gamma0 = _energy0 / self.mass0
2128
2154
  else:
2129
2155
  raise RuntimeError('This statement is unreachable.')
2130
2156
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xtrack
3
- Version: 0.94.0
3
+ Version: 0.94.2
4
4
  Summary: Tracking library for particle accelerators
5
5
  Home-page: https://xsuite.readthedocs.io/
6
6
  Download-URL: https://pypi.python.org/pypi/xtrack
@@ -1 +0,0 @@
1
- __version__ = '0.94.0'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes