Commit 2ffc0736 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Allow to specify specific threshold to jitter function.

parent 553baa09
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -28,12 +28,13 @@ def jitter_causes(df, durations, export=False, file_name=None):
    print("Outliers:", len(outliers), ";", "Threshold[us]:", threshold)


def trace_jitter(data_frame, export=False, file_name=None):
def trace_jitter(data_frame, threshold=None, export=False, file_name=None):
    """
    Displays (and saves) a stacked boxplot of durations.
    """
    thresh = get_outlier_threshold(data_frame["EndToEnd_D"].describe())
    df_no_outliers = data_frame[data_frame["EndToEnd_D"] <= thresh]
    if threshold is None:
        threshold = get_outlier_threshold(data_frame["EndToEnd_D"].describe())
    df_no_outliers = data_frame[data_frame["EndToEnd_D"] <= threshold]
    box(df_no_outliers, export, file_name)
    print("{} / {} are no outliers.".format(len(df_no_outliers), len(data_frame)))
    fig = plt.gcf()