Skip to content

Commit

Permalink
Bug fix for generator MatchRFBucket6D and derivations.
Browse files Browse the repository at this point in the history
Accordingly put version to v1.0.6.

Problem: on certain 32bit python environments,
sys.maxint as a seed is not allowed and leads to crashes.

Quick fix: use maximum int32 value.

Suggestion: use current time allowing for easier reproducibility.
  • Loading branch information
aoeftiger committed Dec 12, 2014
1 parent 056dbeb commit 36d8b8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "1.0.5"
__version__ = "1.0.6"

2 changes: 1 addition & 1 deletion particles/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def __init__(self, psi, rfbucket, sigma_z=None, epsn_z=None):
else:
raise ValueError("Can not generate mismatched matched distribution!")

self.seed = np.random.randint(sys.maxint)
self.seed = np.random.randint(np.iinfo(np.int32).max)

def psi_for_emittance_newton_method(self, epsn_z):
H = self.H
Expand Down

0 comments on commit 36d8b8d

Please sign in to comment.