Skip to content

Commit

Permalink
ignore errors for bd-rate stats
Browse files Browse the repository at this point in the history
  • Loading branch information
nlsdvl committed Oct 4, 2021
1 parent 56fd0cc commit 1b93149
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path
from typing import Dict, Iterable, List, Tuple, Any

from numpy.core.fromnumeric import var
import numpy as np

from anchor import VariantData, iter_variants, AnchorTuple, VariantMetricSet2
from download import AnchorTupleCtx
Expand Down Expand Up @@ -109,8 +109,6 @@ def compare_encoder_configs(ref:Path, test:Path, metrics:List[str], strict=False
except BaseException as e:
if strict:
raise
# err = str(e)[:75] if len(str(e)) > 75 else str(e)
# arates[key] = f'Err: {err}..'
arates[key] = str(e)

bd_rates.append((aref, atest, arates))
Expand Down Expand Up @@ -145,7 +143,11 @@ def csv_dump(data, fp):
for k in fieldnames:
if k == "reference":
continue

v = r[k]
# ignore errors reported as strings
if type(v) == str:
continue

if k in stats["min"]:
stats["min"][k] = min(v, stats["min"][k])
Expand Down

0 comments on commit 1b93149

Please sign in to comment.