Skip to content

Commit

Permalink
πŸ› Fix zero division eror in inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyosun committed Mar 21, 2024
1 parent 368016a commit adc9e5d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lamin_utils/_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ def _validate_stats(identifiers: Iterable, matches: "np.ndarray"):
nonval = _unique_rm_empty(df_val.index[~df_val["__validated__"]]).tolist()

n_unique = len(val) + len(nonval)
if n_unique == 0:
return InspectResult(
validated_df=df_val,
validated=val,
nonvalidated=nonval,
frac_validated=0,
n_empty=0,
n_unique=0,
)
n_empty = df_val.shape[0] - n_unique
frac_nonval = round(len(nonval) / n_unique * 100, 1)
frac_val = 100 - frac_nonval
Expand Down

0 comments on commit adc9e5d

Please sign in to comment.