From 36d8b8da47f63ecf70bb0392b95764001d66ee74 Mon Sep 17 00:00:00 2001 From: Adrian Oeftiger Date: Fri, 12 Dec 2014 17:11:51 +0100 Subject: [PATCH] Bug fix for generator MatchRFBucket6D and derivations. 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. --- _version.py | 2 +- particles/generators.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_version.py b/_version.py index c55bfe39..6c946174 100644 --- a/_version.py +++ b/_version.py @@ -1,2 +1,2 @@ -__version__ = "1.0.5" +__version__ = "1.0.6" diff --git a/particles/generators.py b/particles/generators.py index 5af3cc19..b1084565 100644 --- a/particles/generators.py +++ b/particles/generators.py @@ -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