Skip to content
Snippets Groups Projects
Commit b67d86fb authored by Bert Palm's avatar Bert Palm 🎇
Browse files

[FIX] crossstats faild for empty mask

parent 6ed9eb4f
No related branches found
No related tags found
No related merge requests found
Pipeline #37167 passed with stage
in 2 minutes and 24 seconds
...@@ -309,7 +309,10 @@ class Flags: ...@@ -309,7 +309,10 @@ class Flags:
try: try:
tmp[mask] = value tmp[mask] = value
except Exception: except Exception:
raise ValueError("bad mask") raise ValueError(
f"bad mask. cannot use mask of length {len(mask)} on "
f"data of length {len(tmp)}"
)
else: else:
value = tmp value = tmp
......
...@@ -1226,6 +1226,9 @@ def flagCrossStatistic( ...@@ -1226,6 +1226,9 @@ def flagCrossStatistic(
diff_scores = df.subtract(stat, axis=0).abs() diff_scores = df.subtract(stat, axis=0).abs()
mask = diff_scores > thresh mask = diff_scores > thresh
if mask.empty:
return data, flags
for var in fields: for var in fields:
flags[mask[var], var] = flag flags[mask[var], var] = flag
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment