Skip to content

Commit 9ed18b5

Browse files
authored
Merge pull request #129 from xsuite/feature/coll_in_twiss
Implement include_collective
2 parents 6fd0f13 + 478aa29 commit 9ed18b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

xpart/build_particles.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def build_particles(_context=None, _buffer=None, _offset=None, _capacity=None,
5757
scale_with_transverse_norm_emitt=None,
5858
weight=None,
5959
s_tol=1e-6,
60+
include_collective=False,
6061
**kwargs, # They are passed to the twiss
6162
):
6263

@@ -124,7 +125,7 @@ def build_particles(_context=None, _buffer=None, _offset=None, _capacity=None,
124125
zeta_norm = (zeta_norm.get() if hasattr(zeta_norm, "get") else zeta_norm)
125126
pzeta_norm = (pzeta_norm.get() if hasattr(pzeta_norm, "get") else pzeta_norm)
126127

127-
if line is not None and line.iscollective:
128+
if line is not None and line.iscollective and not include_collective:
128129
logger.warning('Ignoring collective elements in particles generation.')
129130
line = line._get_non_collective_line()
130131

0 commit comments

Comments
 (0)