From 8eb22b17418d589570f37d16bcb1b9379d46f476 Mon Sep 17 00:00:00 2001 From: Adinda de Wit Date: Wed, 9 Oct 2024 13:18:13 +0200 Subject: [PATCH 1/2] Only disable pull calculation if constraint is too small relative to input unceratinty --- python/calculate_pulls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/calculate_pulls.py b/python/calculate_pulls.py index 7879ad8a0c8..6fb45574083 100644 --- a/python/calculate_pulls.py +++ b/python/calculate_pulls.py @@ -31,7 +31,8 @@ def compat(x, x0, sx, sx0): def diffPull(x, x0, sx, sx0): # as defined in http://physics.rockefeller.edu/luc/technical_reports/cdf5776_pulls.pdf - if abs(sx * sx - sx0 * sx0) < 0.001: + # The following protection checks the relative size of the constraint wrt the input uncertainty + if abs((sx * sx - sx0 * sx0)/(sx0 * sx0)) < 0.001: return [0, 999] elif sx > sx0: return [0, 999] From cf61128caa35476e2d3d180695bc3413e7c3a9b8 Mon Sep 17 00:00:00 2001 From: Adinda de Wit Date: Wed, 9 Oct 2024 13:34:28 +0200 Subject: [PATCH 2/2] fix lint --- python/calculate_pulls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/calculate_pulls.py b/python/calculate_pulls.py index 6fb45574083..db4cf1f2065 100644 --- a/python/calculate_pulls.py +++ b/python/calculate_pulls.py @@ -32,7 +32,7 @@ def compat(x, x0, sx, sx0): def diffPull(x, x0, sx, sx0): # as defined in http://physics.rockefeller.edu/luc/technical_reports/cdf5776_pulls.pdf # The following protection checks the relative size of the constraint wrt the input uncertainty - if abs((sx * sx - sx0 * sx0)/(sx0 * sx0)) < 0.001: + if abs((sx * sx - sx0 * sx0) / (sx0 * sx0)) < 0.001: return [0, 999] elif sx > sx0: return [0, 999]