Skip to content
Snippets Groups Projects
Commit 39dd1ce0 authored by David Schäfer's avatar David Schäfer
Browse files

flagger initialization perf improvements through a

reduction of type castings
parent 64f848c8
No related branches found
No related tags found
3 merge requests!193Release 1.4,!188Release 1.4,!82Perf improvements
Pipeline #6503 failed with stage
in 5 minutes and 59 seconds
......@@ -64,14 +64,16 @@ class BaseFlagger(ABC):
if data is not None:
if not isinstance(data, diosT):
data = dios.DictOfSeries(data)
flags = data.copy()
flags[:] = self.UNFLAGGED
flags = dios.DictOfSeries(columns=data.columns)
for c in flags.columns:
flags[c] = pd.Series(self.UNFLAGGED, index=data[c].index)
flags = flags.astype(self.dtype)
else:
if not isinstance(data, diosT):
flags = dios.DictOfSeries(flags)
newflagger = self.copy()
newflagger._flags = flags.astype(self.dtype)
newflagger = self.copy(flags=flags)
return newflagger
def rename(self, field: str, new_name: str):
......
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