Skip to content

Commit 70c8724

Browse files
warn about not being able to patch
1 parent 3368ef4 commit 70c8724

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

smodels/statistics/pyhfInterface.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,20 @@ def getWSInfo(self):
300300
smodelsRegions = self.nsignals[jsName].values() # CR and SR names implemented in the database
301301
if "observations" in ws:
302302
self.updatePyhfNames ( jsName, ws["observations"] )
303+
patchedChannels = set()
304+
allChannels = set ( [ x["name"] for x in ws["observations"] ] )
303305
for i_r, region in enumerate ( self.jsonFiles[jsName] ):
304306
for i_ch, ch in enumerate(ws["observations"]):
305307
## create a patch for the region, but only if channel matches
306308
patch, patchType = self.createPatchForRegion ( region, i_ch, ch, jsName )
307309
if patch != None:
308310
wsChannelsInfo[patchType].append(patch)
311+
patchedChannels.add ( ch['name'] )
309312
break
313+
if allChannels != patchedChannels:
314+
logger.error ( f"could not patch {' '.join(allChannels-patchedChannels)} for {jsName}. Check the database!" )
315+
sys.exit()
316+
310317

311318
wsChannelsInfo["otherRegions"].sort(
312319
key=lambda path: int(path['path'].split("/")[-1]), reverse=True

0 commit comments

Comments
 (0)