From acf7a846b5364352485e30cde5ab4d0e337998b0 Mon Sep 17 00:00:00 2001 From: Dom <97384583+tosemml@users.noreply.github.com> Date: Tue, 29 Aug 2023 13:24:25 -0700 Subject: [PATCH] Use list comp --- tasks/face_segmentation/snp_test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tasks/face_segmentation/snp_test.py b/tasks/face_segmentation/snp_test.py index cdc4d7f80..7378c95fa 100644 --- a/tasks/face_segmentation/snp_test.py +++ b/tasks/face_segmentation/snp_test.py @@ -51,11 +51,11 @@ def main(): sys.exit(1) store = configure_store(aml_config) - fully_trained = [] - for e in store.get_all_status_entities(status='complete'): - if metric_key in e: - fully_trained += [e] - + fully_trained = [ + e for e in store.get_all_status_entities(status='complete') + if metric_key in e + ] + if len(fully_trained) == 0: print(f"No 'complete' models found with required metric '{metric_key}'") sys.exit(1)