Skip to content

Commit

Permalink
In cp_verify_alarm, change async functions
Browse files Browse the repository at this point in the history
  • Loading branch information
plazas committed Dec 16, 2022
1 parent 9874a62 commit 4770c85
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/lsst/ts/watcher/rules/cp_verify_alarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ def __call__(self, topic_callback):
# OCPS response after calling the pipetask
response = json.loads(msg.result)
# Get the dictionary with cp_verify stats, from the butler.
verify_stats = await self.get_cp_verify_stats(response)
verify_stats = self.get_cp_verify_stats(response)
# boolean: did verification fail?
return await self.check_response(response, verify_stats)
return self.check_response(response, verify_stats)

async def check_response(self, response_verify, verify_stats):
def check_response(self, response_verify, verify_stats):
"""Determine if cp_verify tests passed from OCPS response.
Parameters
Expand All @@ -119,7 +119,7 @@ async def check_response(self, response_verify, verify_stats):
job_id_verify = response_verify["job_id"]

if verify_stats["SUCCESS"] is False:
(verify_pass, _, thresholds,) = await self.count_failed_verification_tests(
(verify_pass, _, thresholds,) = self.count_failed_verification_tests(
verify_stats, self.config.verification_threshold
)

Expand All @@ -134,7 +134,7 @@ async def check_response(self, response_verify, verify_stats):
f" threshold: {n_exp_threshold}."
)

async def count_failed_verification_tests(
def count_failed_verification_tests(
self, verify_stats, max_number_failures_per_detector_per_test
):
"""Count number of tests that failed cp_verify.
Expand Down Expand Up @@ -241,7 +241,7 @@ async def count_failed_verification_tests(

return certify_calib, total_counter_failed_tests, thresholds

async def get_cp_verify_stats(self, response_verify):
def get_cp_verify_stats(self, response_verify):
"""Get cp_verify statistics from the butler.
Parameters
Expand Down

0 comments on commit 4770c85

Please sign in to comment.