Skip to content

Commit

Permalink
fixed particles initialisation in random_generators
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonlopaciuk committed Feb 20, 2023
1 parent 162e834 commit 5840adf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Binary file added checkpoint_restart.dat
Binary file not shown.
3 changes: 2 additions & 1 deletion xtrack/random/random_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def generate(self, n_samples=1000, n_seeds=1000, particles=None):
context = self._context
n_seeds = int(n_seeds)
if particles is None:
particles = xp.Particles(state=np.ones(n_seeds), _context=context)
particles = xp.Particles(state=np.ones(n_seeds),
x=np.ones(n_seeds), _context=context)
elif n_seeds != len(particles._rng_s1):
print("Warning: both 'particles' and 'n_seeds' are given, but "
+ "are not compatible. Ignoring 'n_seeds'...")
Expand Down

0 comments on commit 5840adf

Please sign in to comment.