From 3cf832ea653c742ad93eb12b55e83c9b86c68478 Mon Sep 17 00:00:00 2001 From: Wolfgang Waltenberger Date: Wed, 31 Jul 2024 12:40:16 +0200 Subject: [PATCH] small fix for missing type info in jsonFiles --- smodels/statistics/statsTools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smodels/statistics/statsTools.py b/smodels/statistics/statsTools.py index 2b0c4c2b2..b7a275be2 100755 --- a/smodels/statistics/statsTools.py +++ b/smodels/statistics/statsTools.py @@ -223,11 +223,11 @@ def getComputerPyhf(self ): for jsName in globalInfo.jsonFiles: jsonSRs = [] for ir,region in enumerate ( globalInfo.jsonFiles[jsName] ): + if isinstance(region,dict) and not ("type" in region): + region["type"]="SR" if isinstance(region,str): region = { "smodels": region, "type": "SR" } - elif isinstance(region,dict) and not ("type" in region): - region["type"]="SR" - else: + elif not isinstance(region,dict): raise SModelSError("The jsonFiles field should contain lists \ of strings or dictionaries \ (%s is not allowed)" %type(region))