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

refactoring for followup

parent 6dc52d9b
No related branches found
No related tags found
3 merge requests!193Release 1.4,!188Release 1.4,!52Masking b
......@@ -189,14 +189,14 @@ class BaseFlagger(ABC):
"""
if isinstance(flag, pd.Series):
raise TypeError("flag: pd.Series is not allowed")
checkflags = set(toSequence(flag, self.GOOD))
flags_to_compare = set(toSequence(flag, self.GOOD))
flags = self.getFlags(field, loc)
cp = COMPARATOR_MAP[comparator]
# notna() to prevent nans to become True, eg.: `np.nan != 0 -> True`
flagged = flags.notna()
for f in checkflags:
for f in flags_to_compare:
if not self.isValidFlag(f):
raise ValueError(f"invalid flag: {f}")
flagged &= cp(flags, f)
......
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