Skip to content

Commit

Permalink
try a different pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
mlincett committed Oct 13, 2023
1 parent 281d53f commit 1aa58b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions skymap_scanner/recos/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
from datetime import datetime


def check_name(frame: I3Frame, logger, name: str) -> None:
if name not in frame:
raise RuntimeError(f"{name} not in frame.")
def check_name(frame: I3Frame, logger, key: str) -> None:
if key not in frame:
logger.debug(f"Check that {key} is in frame: -> FAIL.")
raise RuntimeError(f"{key} not in frame.")
else:
logger.debug(f"Check that {name} is in frame: -> success.")
logger.debug(f"Check that {key} is in frame: -> success.")


def notify_debug(frame: I3Frame, logger, message):
Expand Down
2 changes: 1 addition & 1 deletion skymap_scanner/recos/splinempe.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def checkName(frame: I3Frame, name: str) -> None:
allowSelfCoincidence=True,
)

tray.add(check_name, logger=logger, name=cls.base_pulseseries)
tray.Add(check_name, f"check-{name}", logger=logger, key=cls.base_pulseseries)

# from icetray/filterscripts/python/baseproc.py
tray.AddModule(
Expand Down

0 comments on commit 1aa58b8

Please sign in to comment.