xcoll 0.6.6__py3-none-any.whl → 0.6.8__py3-none-any.whl

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.

Potentially problematic release.


This version of xcoll might be problematic. Click here for more details.

xcoll/colldb.py CHANGED
@@ -36,7 +36,7 @@ def _dict_keys_to_lower(dct):
36
36
  else:
37
37
  return dct
38
38
 
39
-
39
+ # TODO: need better handling of beam argument (not hardcoded 'b1' and 'b2' strings)
40
40
  def _get_coll_dct_by_beam(coll, beam):
41
41
  # The dictionary can be a CollimatorDatabase for a single beam (beam=None)
42
42
  # or for both beams (beam='b1' or beam='b2)
@@ -51,7 +51,7 @@ def _get_coll_dct_by_beam(coll, beam):
51
51
  raise ValueError("Need to specify a beam, because the given dict is for both beams!")
52
52
  return coll[beam]
53
53
 
54
- elif len(beam_in_db) == 1:
54
+ elif len(beam_in_db) == 1 and beam_in_db[0].lower() in ['b1','b2']:
55
55
  if beam is None:
56
56
  beam = beam_in_db[0].lower()
57
57
  elif beam != beam_in_db[0].lower():
@@ -551,7 +551,8 @@ class CollimatorDatabase:
551
551
  prop_dict.update(kwargs)
552
552
  el = cls(**prop_dict)
553
553
  el.emittance = [self.nemitt_x, self.nemitt_y]
554
- if 'family' in self[name] and self[name]['family'].lower() != 'unknown':
554
+ if 'family' in self[name] and self[name]['family'] \
555
+ and self[name]['family'].lower() != 'unknown':
555
556
  if self[name]['family'] == name:
556
557
  raise ValueError(f"Collimator {name} has the same name as its family!")
557
558
  el.family = self[name]['family']
xcoll/general.py CHANGED
@@ -12,5 +12,5 @@ citation = "F.F. Van der Veken, et al.: Recent Developments with the New Tools f
12
12
  # ======================
13
13
  # Do not change
14
14
  # ======================
15
- __version__ = '0.6.6'
15
+ __version__ = '0.6.8'
16
16
  # ======================
xcoll/lossmap.py CHANGED
@@ -254,7 +254,8 @@ class LossMap:
254
254
  prev_elem = len(line.element_names) - 1
255
255
  else:
256
256
  prev_elem = elem - 1
257
- if line.element_names[prev_elem] in coll_elements:
257
+ if line.element_names[prev_elem] in coll_elements \
258
+ and line[prev_elem].active:
258
259
  if verbose:
259
260
  print(f"Found at {line.element_names[elem]}, "
260
261
  + f"moved to {line.element_names[elem-1]}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: xcoll
3
- Version: 0.6.6
3
+ Version: 0.6.8
4
4
  Summary: Xsuite collimation package
5
5
  License: Apache-2.0
6
6
  Author: Frederik F. Van der Veken
@@ -19,10 +19,10 @@ Requires-Dist: pytest ; extra == "tests"
19
19
  Requires-Dist: pytest-html ; extra == "tests"
20
20
  Requires-Dist: pytest-xdist ; extra == "tests"
21
21
  Requires-Dist: ruamel-yaml (>=0.17.31,<0.18.15)
22
- Requires-Dist: xdeps (>=0.10.6)
22
+ Requires-Dist: xdeps (>=0.10.7)
23
23
  Requires-Dist: xobjects (>=0.5.3)
24
24
  Requires-Dist: xpart (>=0.23.1)
25
- Requires-Dist: xtrack (>=0.90.2)
25
+ Requires-Dist: xtrack (>=0.93.2)
26
26
  Project-URL: Bug Tracker, https://github.com/xsuite/xsuite/issues
27
27
  Project-URL: Documentation, https://xsuite.readthedocs.io/
28
28
  Project-URL: Homepage, https://github.com/xsuite/xcoll
@@ -10,16 +10,13 @@ xcoll/beam_elements/elements_src/emittance_monitor.h,sha256=vlHzQFoUjKQHWBmzpaSz
10
10
  xcoll/beam_elements/elements_src/everest_block.h,sha256=ITSzfiqwm8ZNIkAj_odQkAjKhPcdT8b0AUlq_uxtsqI,6562
11
11
  xcoll/beam_elements/elements_src/everest_collimator.h,sha256=fkD5GazVv2zlmqyb6s9zVNMq6baXeFb_pf7gg9TKjNc,9787
12
12
  xcoll/beam_elements/elements_src/everest_crystal.h,sha256=LISp_9NEWMIi5GvZ3LwPfeSbmsbXvHWcTqxW6eCCsiE,11951
13
- xcoll/beam_elements/elements_src/rf_sweep.h,sha256=eTPPSJvFrkoh9STI0hmmiozwMUL-TQVhz1mOZQhObWE,846
14
13
  xcoll/beam_elements/elements_src/transparent_collimator.h,sha256=pA_Fxx85N87iSbpHSjR2OSOx6JN9e38T1pOUKrC7zxs,4610
15
14
  xcoll/beam_elements/elements_src/transparent_crystal.h,sha256=DGX4uL0hpm4njOypoPuEWtMzYxnL9jQkf2ZrGaS0alI,4128
16
15
  xcoll/beam_elements/everest.py,sha256=iJva_S0OQnmG-qj7rIAiUCssu5WL_Qs5P_n6Qx-IWzo,9080
17
16
  xcoll/beam_elements/monitor.py,sha256=baMYT_PNya8KX35ReeMwk5Cm04ePUqiDF_s69L5GTX0,16968
18
- xcoll/beam_elements/sweep.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
17
  xcoll/beam_elements/transparent.py,sha256=AZOWfH3dvsetL6DjQGejUgX7T18e_3omIIffG_1gwc0,2894
20
- xcoll/colldb.py,sha256=WaJC6gkDNVvxo65OhucTM6Fwo6pgRFHNnBnHSkiX7AQ,31054
21
- xcoll/general.py,sha256=gBV-L5-jNV6jp-GHZBorNQ5sTKxbqKEZ4svcBweWyzA,534
22
- xcoll/geometry.md,sha256=AARDOk5lZWFBAllX75UYMRywSYSB04FIlYWE0ra1t5c,1623
18
+ xcoll/colldb.py,sha256=4QwvWH-KYTa6xyaVS7Y8S473T6RHXOER8B2xZjeNahI,31213
19
+ xcoll/general.py,sha256=GNj4NRQunkW8IlcM2w6l5kqCSHn5yGE3RhKPbKdAZEs,534
23
20
  xcoll/headers/checks.h,sha256=qdXsOTBOK1MwW6bdFF93j4yE648mcDtEv5rGN1w9sfk,1582
24
21
  xcoll/headers/particle_states.py,sha256=N8ehLtg99358I4RGCJ3sjuKCk2LVdGqgVx2xGoHrRdM,1959
25
22
  xcoll/initial_distribution.py,sha256=CHhqeCVjVOyaBWhfy2sDgLwIgtXZoqcTW-su-M2YByE,10989
@@ -28,7 +25,7 @@ xcoll/interaction_record/interaction_record.py,sha256=cCjfVCYUJaV0Y-pCljA2_u8GLy
28
25
  xcoll/interaction_record/interaction_record_src/interaction_record.h,sha256=0rNagnfSGc2i1jauOMIcDbj9QFic9dV_MOyqVx1kw5Q,6067
29
26
  xcoll/interaction_record/interaction_types.py,sha256=XTeg2dcImMpqhTqzkJKh6JYam2v9gUMhED-dDKLsilk,2894
30
27
  xcoll/line_tools.py,sha256=JBySkKKZ-RGumqAZF_8PSQ3OV0M87P78NeQgbXAdFc4,16699
31
- xcoll/lossmap.py,sha256=HLdhej9tUjk36T5BulVWurJtfiNa61L_1X7-8kT6JoQ,28407
28
+ xcoll/lossmap.py,sha256=f2kMb0Md-F9rD7Ef0jQRAIjHArk6W0gE8v1koRL_T-U,28452
32
29
  xcoll/plot.py,sha256=27fYdXstPg3o8XyeBlPuD2yz0GR3dKkNWy4kO2BD9WA,4071
33
30
  xcoll/prebuilt_kernel_definitions/__init__.py,sha256=Dju9g0ME0F8FpFUZREyiEcd8rVyQqIro8_8LKqegTtk,291
34
31
  xcoll/prebuilt_kernel_definitions/element_inits.py,sha256=9Qm34JXN7F08inWzXP6g6DU57ypRbyqHYwPK9Oc9BC4,219
@@ -60,9 +57,9 @@ xcoll/scattering_routines/geometry/rotation.h,sha256=lO3RaQBys9r0ROMjR8T8Rr7UsIE
60
57
  xcoll/scattering_routines/geometry/segments.h,sha256=7nKnnin2ByxkKyaYwGvFaqgLQg5uBba4CdLHL7L3iQs,7667
61
58
  xcoll/scattering_routines/geometry/sort.h,sha256=b1MkFO2ddzv1fWGeQzsLuz46qo2pKyRSXHjoAEVU7Ts,5763
62
59
  xcoll/xaux.py,sha256=mh4E_jhaUFm2LOKawJ0b6X4zuz8JiJhx6w7GcnRgIXQ,2291
63
- xcoll-0.6.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
64
- xcoll-0.6.6.dist-info/METADATA,sha256=iMC5LKFX-eIW1dep7AnMhdSb_oOl8weeWYZARokc08w,2953
65
- xcoll-0.6.6.dist-info/NOTICE,sha256=6DO_E7WCdRKc42vUoVVBPGttvQi4mRt9fAcxj9u8zy8,74
66
- xcoll-0.6.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
67
- xcoll-0.6.6.dist-info/entry_points.txt,sha256=fC9oojAU6WjKujnGBodo7ZcEeBGfSfeLPO5287echdY,26
68
- xcoll-0.6.6.dist-info/RECORD,,
60
+ xcoll-0.6.8.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
61
+ xcoll-0.6.8.dist-info/METADATA,sha256=Vd4tt248o0zu1dCk3dxdO1FGuU8_7cNtVf3K8vVrRcQ,2953
62
+ xcoll-0.6.8.dist-info/NOTICE,sha256=6DO_E7WCdRKc42vUoVVBPGttvQi4mRt9fAcxj9u8zy8,74
63
+ xcoll-0.6.8.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
64
+ xcoll-0.6.8.dist-info/entry_points.txt,sha256=fC9oojAU6WjKujnGBodo7ZcEeBGfSfeLPO5287echdY,26
65
+ xcoll-0.6.8.dist-info/RECORD,,
@@ -1,23 +0,0 @@
1
- // copyright ############################### #
2
- // This file is part of the Xcoll package. #
3
- // Copyright (c) CERN, 2025. #
4
- // ######################################### #
5
-
6
- #ifndef XCOLL_RF_SWEEP_H
7
- #define XCOLL_RF_SWEEP_H
8
-
9
- /*gpufun*/
10
- void RFSweep_track_local_particle(RFSweepData el, LocalParticle* part0){
11
- double const step = RFSweepData_get__rf_sweep_df_step(el); // L*df/(f0 + df)
12
- int64_t const start_turn = RFSweepData_get_start_turn(el);
13
- int64_t const stop_turn = RFSweepData_get_stop_turn(el);
14
-
15
- //start_per_particle_block (part0->part)
16
- int64_t at_turn = LocalParticle_get_at_turn(part);
17
- if (at_turn >= start_turn && at_turn <= stop_turn){
18
- LocalParticle_add_to_zeta(part, -(at_turn - start_turn + 1)*step);
19
- }
20
- //end_per_particle_block
21
- }
22
-
23
- #endif /* XCOLL_RF_SWEEP_H */
File without changes
xcoll/geometry.md DELETED
@@ -1,42 +0,0 @@
1
- PSEUDOCODE for material interactions tracking in collimator
2
- ===========================================================
3
-
4
- - create DriftTrajectory from particle
5
- - loop:
6
- - find first crossing with collimator shape (segments)
7
- - if distance larger than end of BeamElement -> move particle to exendit and break loop
8
- - move particle to collimator impact point
9
- - create MCSTrajectory from new particle
10
- - loop:
11
- - find first crossing with collimator shape (segments)
12
- - do not move, but calculate path length
13
- - compare to distance to nuclear interaction
14
- - shortest wins (nuclear or exit)
15
- - move to next point
16
- - when at exit, create DriftTrajectory from particle
17
-
18
-
19
-
20
- PSEUDOCODE for material interactions tracking in crystal
21
- ========================================================
22
-
23
- - create DriftTrajectory from particle
24
- - loop:
25
- - find first crossing with crystal shape (segments)
26
- - if distance larger than end of BeamElement -> move particle to end and break loop
27
- - move particle to crystal impact point
28
- - create MCSTrajectory (if amorphous) or CircularTrajectory (if channelling) from new particle
29
- - loop:
30
- - find first crossing with crystal shape (segments)
31
- - do not move, but calculate path length
32
- - compare to distance to nuclear interaction and dechannelling
33
- - shortest wins (nuclear, dechannelling, or exit)
34
- - move to next point
35
- - when at exit, create DriftTrajectory from particle
36
-
37
-
38
- PSEUDOCODE for crossing finder
39
- ==============================
40
-
41
- - if DriftTrajectory and any segment
42
- => use analytical
File without changes
File without changes
File without changes