From 10246a1187c5ed0f5d522b3ee9f3c0916b926543 Mon Sep 17 00:00:00 2001 From: thuiop Date: Tue, 18 May 2021 15:08:44 +0100 Subject: [PATCH] Put list into a constant --- btk/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/btk/utils.py b/btk/utils.py index 131641619..36e8724b8 100644 --- a/btk/utils.py +++ b/btk/utils.py @@ -4,6 +4,8 @@ import numpy as np from astropy.table import Table +BLEND_RESULT_KEYS = ("blend_images", "isolated_images", "blend_list") + def load_blend_results(path, survey): """Load results exported from a DrawBlendsGenerator. @@ -114,13 +116,13 @@ def load_all_results(path, surveys, measure_names, n_batch): The three dictionnaries corresponding to the results. """ blend_results = {} - for key in ["blend_images", "isolated_images", "blend_list"]: + for key in BLEND_RESULT_KEYS: blend_results[key] = {} measure_results = {} metrics_results = {} for s in surveys: blend_results_temp = load_blend_results(path, s) - for key in ["blend_images", "isolated_images", "blend_list"]: + for key in BLEND_RESULT_KEYS: blend_results[key][s] = blend_results_temp[key] for meas in measure_names: