From 524e1cee0f70e56fcf8077797e5fc66db52bc376 Mon Sep 17 00:00:00 2001 From: "Jack Y. Araz" Date: Mon, 9 Dec 2024 20:45:35 -0500 Subject: [PATCH] improve code efficiency --- src/spey_pyhf/simplify.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/spey_pyhf/simplify.py b/src/spey_pyhf/simplify.py index 43f3ac5..0b01d10 100644 --- a/src/spey_pyhf/simplify.py +++ b/src/spey_pyhf/simplify.py @@ -426,9 +426,11 @@ def __call__( third_moment=third_moments, ) elif convert_to == "default_pdf.effective_sigma": + # Get 68% quantiles q = (1.0 - (norm.cdf(1.0) - norm.cdf(-1.0))) / 2.0 - absolute_uncertainty_envelops = list( - zip(np.quantile(samples, q, axis=0), np.quantile(samples, 1 - q, axis=0)) + absolute_uncertainty_envelops = np.stack( + [np.quantile(samples, q, axis=0), np.quantile(samples, 1 - q, axis=0)], + axis=1, ) save_kwargs.update( {"absolute_uncertainty_envelops": absolute_uncertainty_envelops}