Commit a489a074 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Allow reading a mix of old and new format scores

parent 335937fd
Pipeline #52484 passed with stage
in 14 minutes and 12 seconds
......@@ -386,6 +386,9 @@ def split(filename, ncolumns=None, sort=False):
This array contains the list of scores, for which the ``claimed_id`` and
the ``real_id`` are identical (see :py:func:`four_column`)
"""
if iscsv(filename):
return split_csv_scores(filename)
ncolumns = _estimate_score_file_format(filename, ncolumns)
if ncolumns == 4:
neg, pos = split_four_column(filename)
......
......@@ -56,8 +56,7 @@ def metrics(ctx, scores, evaluation, **kwargs):
if "criterion" in ctx.meta and ctx.meta["criterion"] == "rr":
process = bio_figure.Metrics(ctx, scores, evaluation, load.cmc)
else:
func = load.split_csv_scores if iscsv(scores[0]) else load.split
process = bio_figure.Metrics(ctx, scores, evaluation, func)
process = bio_figure.Metrics(ctx, scores, evaluation, load.split)
process.run()
......@@ -65,8 +64,7 @@ def metrics(ctx, scores, evaluation, **kwargs):
common_options.ROC_HELP.format(score_format=SCORE_FORMAT, command="bob bio roc")
)
def roc(ctx, scores, evaluation, **kargs):
func = load.split_csv_scores if iscsv(scores[0]) else load.split
process = bio_figure.Roc(ctx, scores, evaluation, func)
process = bio_figure.Roc(ctx, scores, evaluation, load.split)
process.run()
......@@ -74,8 +72,7 @@ def roc(ctx, scores, evaluation, **kargs):
common_options.DET_HELP.format(score_format=SCORE_FORMAT, command="bob bio det")
)
def det(ctx, scores, evaluation, **kargs):
func = load.split_csv_scores if iscsv(scores[0]) else load.split
process = bio_figure.Det(ctx, scores, evaluation, func)
process = bio_figure.Det(ctx, scores, evaluation, load.split)
process.run()
......@@ -83,8 +80,7 @@ def det(ctx, scores, evaluation, **kargs):
common_options.EPC_HELP.format(score_format=SCORE_FORMAT, command="bob bio epc")
)
def epc(ctx, scores, **kargs):
func = load.split_csv_scores if iscsv(scores[0]) else load.split
process = measure_figure.Epc(ctx, scores, True, func)
process = measure_figure.Epc(ctx, scores, True, load.split)
process.run()
......@@ -92,8 +88,7 @@ def epc(ctx, scores, **kargs):
common_options.HIST_HELP.format(score_format=SCORE_FORMAT, command="bob bio hist")
)
def hist(ctx, scores, evaluation, **kwargs):
func = load.split_csv_scores if iscsv(scores[0]) else load.split
process = bio_figure.Hist(ctx, scores, evaluation, func)
process = bio_figure.Hist(ctx, scores, evaluation, load.split)
process.run()
......@@ -120,9 +115,8 @@ def evaluate(ctx, scores, evaluation, **kwargs):
criteria=CRITERIA,
)
def multi_metrics(ctx, scores, evaluation, protocols_number, **kwargs):
func = load.split_csv_scores if iscsv(scores[0]) else load.split
ctx.meta["min_arg"] = protocols_number * (2 if evaluation else 1)
process = bio_figure.MultiMetrics(ctx, scores, evaluation, func)
process = bio_figure.MultiMetrics(ctx, scores, evaluation, load.split)
process.run()
......
Supports Markdown
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