Commit f1a048c6 authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV

allow missing files scoring

parent d6e7ca12
Pipeline #12820 passed with stages
in 7 minutes and 51 seconds
......@@ -32,7 +32,8 @@ def _compute_scores(algorithm, toscore_objects, allow_missing_files):
for i, toscore_element in enumerate(toscore_objects):
# filter missing files
if allow_missing_files and not os.path.exists(toscore_element):
# we keep the NaN score
# we keep NaN score for such elements
scores.insert(i, [numpy.nan])
continue
# read toscore
toscore = algorithm.read_toscore_object(toscore_element)
......@@ -106,10 +107,6 @@ def _save_scores(score_file, scores, toscore_objects, write_compressed=False):
id_str = (str(toscore_object.client_id)).zfill(3)
sample_name = str(toscore_object.make_path())
# we can have empty score list if allow_missing_files was true in _compute_scores()
if not scores[i]:
scores[i] = [numpy.nan] # create a NaN score for such
# scores[i] is a list, so
# each sample is allowed to have multiple scores
for score in scores[i]:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment