<jupyter_start><jupyter_text>Time<jupyter_code>g = sns.catplot (x='name', y='time_secs', hue='variant', data = df, kind ='bar', aspect=4)
g.set_xticklabels(rotation=90)<jupyter_output><empty_output><jupyter_text>Normalized<jupyter_code>def create_column(df, variant, metric):
    df = pd.DataFrame.copy(df)
    variant_metric_name = list([ zip(df[metric], df[x], df['name'])
            for x in df.columns.array if x == "variant" ][0])
    name_metric = {n:t for (t, v, n) in variant_metric_name if v == variant}
    return name_metric

def add_display_name(df,variant, metric):
    name_metric = create_column(pd.DataFrame.copy(df), variant, metric)
    disp_name = [name+" ("+str(round(name_metric[name], 2))+")" for name in df["name"]]
    df["display_name"] = pd.Series(disp_name, index=df.index)
    return df

def normalise(df,variant,topic,additionalTopics=[]):
    df = add_display_name(df,variant,topic)
    df = df.sort_values(["name","variant"])
    grouped = df.filter(items=['name',topic,'variant','display_name']+additionalTopics).groupby('variant')
    ndata_frames = []
    for group in grouped:
        (v,data) = group
        if(v != variant):
            data['b'+topic] = grouped.get_group(variant)[topic].values
            data[['n'+topic]] = data[[topic]].div(grouped.get_group(variant)[topic].values, axis=0)
            for t in additionalTopics:
                data[[t]] = grouped.get_group(variant)[t].values
            ndata_frames.append(data)
            df = pd.concat(ndata_frames)
            return df
        else:
            print("The selected baseline variant is equal to the other variants\n" 
                  + "Update the dropdowns with different varians to plot normalisation graphs\n")
            return None

def plot_normalised(df,variant,topic):
    if df is not None:
        df = pd.DataFrame.copy(df)
        df.sort_values(by=[topic],inplace=True)
        df[topic] = df[topic] - 1
        g = sns.catplot (x="display_name", y=topic, hue='variant', data = df, kind ='bar', aspect=4, bottom=1)
        g.set_xticklabels(rotation=90)
        g.ax.legend(loc=8)
        g._legend.remove()
        g.ax.set_xlabel("Benchmarks")
        return g
        # g.ax.set_yscale('log')
    else:
        print("ndf is equal to None, possibly due to variants being equal to the baseline variant\n")
ndf = normalise(df, selected_baseline,'time_secs')
plot_normalised(ndf, selected_baseline,'ntime_secs')<jupyter_output>The selected baseline variant is equal to the other variants
Update the dropdowns with different varians to plot normalisation graphs

ndf is equal to None, possibly due to variants being equal to the baseline variant<jupyter_text>Top heap words<jupyter_code>g = sns.catplot (x='name', y='gc.top_heap_words', hue='variant', data = df, kind ='bar', aspect=4)
g.set_xticklabels(rotation=90)<jupyter_output><empty_output><jupyter_text>Normalised<jupyter_code>ndf = normalise(df,selected_baseline,'gc.top_heap_words')
plot_normalised(ndf,selected_baseline,'ngc.top_heap_words')<jupyter_output>The selected baseline variant is equal to the other variants
Update the dropdowns with different varians to plot normalisation graphs

ndf is equal to None, possibly due to variants being equal to the baseline variant<jupyter_text>Max RSS (KB)<jupyter_code>g = sns.catplot (x='name', y='maxrss_kB', hue='variant', data = df, kind ='bar', aspect=4)
g.set_xticklabels(rotation=90)<jupyter_output><empty_output><jupyter_text>Normalised<jupyter_code>ndf = normalise(df,selected_baseline,'maxrss_kB')
plot_normalised(ndf,selected_baseline,'nmaxrss_kB')<jupyter_output>The selected baseline variant is equal to the other variants
Update the dropdowns with different varians to plot normalisation graphs

ndf is equal to None, possibly due to variants being equal to the baseline variant<jupyter_text>Major Collections<jupyter_code>g = sns.catplot (x='name', y='gc.major_collections', hue='variant', data = df, kind ='bar', aspect=4)
g.set_xticklabels(rotation=90)<jupyter_output><empty_output><jupyter_text>Normalised<jupyter_code>ndf = normalise(df,selected_baseline,'gc.major_collections')
plot_normalised(ndf,selected_baseline,'ngc.major_collections')<jupyter_output>The selected baseline variant is equal to the other variants
Update the dropdowns with different varians to plot normalisation graphs

ndf is equal to None, possibly due to variants being equal to the baseline variant<jupyter_text>Major words<jupyter_code>g = sns.catplot (x='name', y='gc.major_words', hue='variant', data = df, kind ='bar', aspect=4)
g.set_xticklabels(rotation=90)<jupyter_output><empty_output><jupyter_text>Normalised<jupyter_code>ndf = normalise(df,selected_baseline,'gc.major_words')
plot_normalised(ndf,selected_baseline,'ngc.major_words')<jupyter_output>The selected baseline variant is equal to the other variants
Update the dropdowns with different varians to plot normalisation graphs

ndf is equal to None, possibly due to variants being equal to the baseline variant<jupyter_text>Minor Collections<jupyter_code>g = sns.catplot (x='name', y='gc.minor_collections', hue='variant', data = df, kind ='bar', aspect=4)
g.set_xticklabels(rotation=90)<jupyter_output><empty_output><jupyter_text>Normalised<jupyter_code>ndf = normalise(df,selected_baseline,'gc.minor_collections')
plot_normalised(ndf,selected_baseline,'ngc.minor_collections')<jupyter_output>The selected baseline variant is equal to the other variants
Update the dropdowns with different varians to plot normalisation graphs

ndf is equal to None, possibly due to variants being equal to the baseline variant
{'fraction_non_alphanumeric': 0.11477454999108894, 'fraction_numerical': 0.004811976474781679, 'mean_word_length': 5.450574712643678, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '12', 'dir': 'jupyter-structured-clean-dedup', 'id': '623674', 'license': 'MIT', 'n_tokens_mistral': 1874, 'n_tokens_neox': 1797, 'n_words': 441, 'path': 'notebooks/sequential_nightly.ipynb', 'repo_name': 'shubhamkumar13/sandmark-nightly', 'size': '5611'}