Skip to content

Commit

Permalink
Better error for missing input (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsmith- authored Jun 18, 2024
1 parent aa4e4e0 commit dfff1d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/correctionlib/schemav2.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ def summarize(
self, nodecount: Dict[str, int], inputstats: Dict[str, _SummaryInfo]
) -> None:
nodecount["Category"] += 1
if self.input not in inputstats:
raise RuntimeError(
f"The input variable {self.input} of a Category node is not defined "
"in the inputs of the Correction object"
)
inputstats[self.input].values |= {item.key for item in self.content}
inputstats[self.input].default |= self.default is not None
for item in self.content:
Expand Down

0 comments on commit dfff1d8

Please sign in to comment.