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

now we also log the process time of a function with debug().

a implementation with a finally clause would be possible, but make the code look like spaghetti. :P
parent fe7e0920
No related branches found
No related tags found
2 merge requests!193Release 1.4,!188Release 1.4
Pipeline #5849 passed with stage
in 6 minutes and 40 seconds
......@@ -14,6 +14,7 @@ from typing import List, Tuple
import pandas as pd
import dios
import numpy as np
import timeit
from saqc.lib.plotting import plotHook, plotAllHook
from saqc.lib.tools import isQuoted
......@@ -153,10 +154,16 @@ class SaQC:
logger.debug(f"processing: {field}, {func.__name__}, {func.kwargs}")
try:
t0 = timeit.default_timer()
data_result, flagger_result = func(data=data, flagger=flagger, field=field)
except Exception as e:
t1 = timeit.default_timer()
logger.debug(f"{func.__name__} failed after {t1-t0} sec")
_handleErrors(e, func, field, self._error_policy)
continue
else:
t1 = timeit.default_timer()
logger.debug(f"{func.__name__} finished after {t1-t0} sec")
if func.plot:
plotHook(
......
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