From 9840dc893fa676718a2ea29b423c3442fb6d73e8 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:25:44 +0200 Subject: [PATCH] FIX: set seed for angular phase space generator (#232) --- docs/zz.polarization-fit.ipynb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/zz.polarization-fit.ipynb b/docs/zz.polarization-fit.ipynb index 5c8b6ec4..e07dc8bb 100644 --- a/docs/zz.polarization-fit.ipynb +++ b/docs/zz.polarization-fit.ipynb @@ -109,9 +109,10 @@ "# Dalitz variables\n", "PHSP = generate_phasespace_sample(DECAY, N_EVENTS, seed=0)\n", "# Decay plane variables\n", - "PHSP[\"phi\"] = np.random.uniform(-np.pi, +np.pi, N_EVENTS)\n", - "PHSP[\"cos_theta\"] = np.random.uniform(-1, +1, N_EVENTS)\n", - "PHSP[\"chi\"] = np.random.uniform(-np.pi, +np.pi, N_EVENTS)" + "RNG = np.random.default_rng(seed=0)\n", + "PHSP[\"phi\"] = RNG.uniform(-np.pi, +np.pi, N_EVENTS)\n", + "PHSP[\"cos_theta\"] = RNG.uniform(-1, +1, N_EVENTS)\n", + "PHSP[\"chi\"] = RNG.uniform(-np.pi, +np.pi, N_EVENTS)" ] }, {