Skip to content

Commit

Permalink
Merge branch 'handlers' of github.com:qiboteam/qibocal into handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Jan 10, 2024
2 parents 0688f0e + ad708a0 commit 8b54280
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/qibocal/auto/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,16 @@ def validate(
index = self.method(results=results, target=target)

if index == -1:
# -1 denotes Normal()
return Normal(), None
else:
try:
return (
self.outcomes[index]
if len(self.outcomes[index]) > 1
else (self.outcomes[index], None)
)
except (TypeError, IndexError):
# TypeError to handle the case where index is None
# IndexError to handle the case where index not in outcomes
log.error("Stopping execution due to error in validation.")
return Failure(), None

try:
return (
self.outcomes[index]
if len(self.outcomes[index]) > 1
else (self.outcomes[index], None)
)
except (TypeError, IndexError):
# TypeError to handle the case where index is None
# IndexError to handle the case where index not in outcomes
log.error("Stopping execution due to error in validation.")
return Failure(), None

0 comments on commit 8b54280

Please sign in to comment.