Commit 9aa18b66 authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Merge branch 'main' into 1452-default-reverb-configuration-not-affecting-ivas_rend-properly

parents b7b4b3e7 2b2b178a
Loading
Loading
Loading
Loading
Loading
+67 −46
Original line number Diff line number Diff line
@@ -571,6 +571,10 @@ int main(
        }
    }
#else
    /*-----------------------------------------------------------------*
     * Print config information
     *-----------------------------------------------------------------*/

    if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -836,6 +840,7 @@ cleanup:
        free( arg.aeSequence.pID );
        free( arg.aeSequence.pValidity );
    }

#ifdef DEBUG_SBA_AUDIO_DUMP
    IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels );

@@ -1226,7 +1231,6 @@ static bool parseCmdlIVAS_dec(
        }
#endif
#endif /* #ifdef DEBUGGING */

        else if ( strcmp( argv_to_upper, "-MIME" ) == 0 )
        {
            arg->inputFormat = IVAS_DEC_INPUT_FORMAT_MIME;
@@ -1251,6 +1255,7 @@ static bool parseCmdlIVAS_dec(
        {
            int32_t tmp;
            i++;

            if ( i < argc - 3 )
            {
                if ( !is_digits_only( argv[i] ) )
@@ -1284,7 +1289,6 @@ static bool parseCmdlIVAS_dec(
        }
        else if ( strcmp( argv_to_upper, "-OTR" ) == 0 )
        {

            strncpy( argv_to_upper, argv[i + 1], sizeof( argv_to_upper ) - 1 );
            argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0';
            to_upper( argv_to_upper );
@@ -1393,6 +1397,7 @@ static bool parseCmdlIVAS_dec(
            strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 );
            argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0';
            to_upper( argv_to_upper );

            if ( ( strcmp( argv_to_upper, "CENTER" ) == 0 ) || ( strchr( argv_to_upper, 'C' ) != NULL ) )
            {
                arg->non_diegetic_pan_gain = 0.f;
@@ -1590,6 +1595,7 @@ static bool parseCmdlIVAS_dec(
        /*-----------------------------------------------------------------*
         * Option not recognized
         *-----------------------------------------------------------------*/

        else
        {
            fprintf( stderr, "Error: Unknown option %s or wrong number of parameters!\n\n", argv[i] );
@@ -1844,6 +1850,35 @@ static int16_t app_own_random( int16_t *seed )
}
#endif

/*---------------------------------------------------------------------*
 * resetHeadRotation()
 *
 *
 *---------------------------------------------------------------------*/

static void resetHeadRotation(
    const int16_t num_subframes,  /* i  : number of subframes   */
    IVAS_QUATERNION *pQuaternion, /* o  : head-tracking data    */
    IVAS_VECTOR3 *pPos            /* o  : listener position     */

)
{
    int16_t i;

    for ( i = 0; i < num_subframes; i++ )
    {
        pQuaternion[i].w = -3.0f;
        pQuaternion[i].x = 0.0f;
        pQuaternion[i].y = 0.0f;
        pQuaternion[i].z = 0.0f;
        pPos[i].x = 0.0f;
        pPos[i].y = 0.0f;
        pPos[i].z = 0.0f;
    }

    return;
}


/*---------------------------------------------------------------------*
 * initOnFirstGoodFrame()
@@ -2165,6 +2200,7 @@ static ivas_error initOnFirstGoodFrame(
            fprintf( stderr, "\nError getting render frame size in samples\n" );
            return error;
        }

        if ( ( error = IVAS_DEC_GetReferencesUpdateFrequency( hIvasDec, vec_pos_len ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError getting render frame size in samples\n" );
@@ -2292,7 +2328,6 @@ static ivas_error decodeG192(
    /* we always start with needing a new frame */
    needNewFrame = true;


    if ( !arg.quietModeEnabled )
    {
        fprintf( stdout, "\n------ Running the decoder ------\n\n" );
@@ -2369,8 +2404,6 @@ static ivas_error decodeG192(

    while ( 1 )
    {
        /* Read next frame if not enough samples availble */

        /* reference vector */
        if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 )
        {
@@ -2417,16 +2450,7 @@ static ivas_error decodeG192(
        {
            if ( headRotReader == NULL )
            {
                for ( i = 0; i < (int16_t) num_subframes; i++ )
                {
                    Quaternions[i].w = -3.0f;
                    Quaternions[i].x = 0.0f;
                    Quaternions[i].y = 0.0f;
                    Quaternions[i].z = 0.0f;
                    Pos[i].x = 0.0f;
                    Pos[i].y = 0.0f;
                    Pos[i].z = 0.0f;
                }
                resetHeadRotation( num_subframes, Quaternions, Pos );
            }
            else
            {
@@ -2640,9 +2664,6 @@ static ivas_error decodeG192(
                    fprintf( stderr, "\nError in IVAS_DEC_GetSplitBinauralBitstream: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }

                nSamplesRendered += nSamplesRendered_loop;
                nSamplesToRender -= nSamplesRendered_loop;
            }
            else
            {
@@ -2651,10 +2672,10 @@ static ivas_error decodeG192(
                    fprintf( stderr, "\nError in IVAS_DEC_GetSamplesRenderer(): %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
            }

            nSamplesRendered += nSamplesRendered_loop;
            nSamplesToRender -= nSamplesRendered_loop;
            }

            if ( needNewFrame )
            {
@@ -2730,7 +2751,7 @@ static ivas_error decodeG192(
            }
        }

        /* Write ISm metadata to external file(s) */
        /* Write ISM metadata to external file(s) */
        if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM )
@@ -2770,6 +2791,7 @@ static ivas_error decodeG192(
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }

                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -2784,6 +2806,7 @@ static ivas_error decodeG192(
                }
            }
        }

        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
#ifdef WMOPS
        if ( vec_pos_update == 0 )
@@ -2802,8 +2825,6 @@ static ivas_error decodeG192(
    {
        int16_t nSamplesFlushed;

        /* Feed into decoder */

        /* reference vector */
        if ( arg.enableReferenceVectorTracking )
        {
@@ -2867,7 +2888,7 @@ static ivas_error decodeG192(
            }
        }

        /* decode and get samples */
        /* flush remaining audio */
        if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -2881,7 +2902,7 @@ static ivas_error decodeG192(
            goto cleanup;
        }

        /* Write ISm metadata to external file(s) */
        /* Write ISM metadata to external file(s) */
        if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM )
@@ -2920,6 +2941,7 @@ static ivas_error decodeG192(
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }

                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -3115,7 +3137,15 @@ cleanup:
#endif

#ifdef SUPPORT_JBM_TRACEFILE
static ivas_error writeJbmTraceFileFrameWrapper( const void *data, void *writer )
/*---------------------------------------------------------------------*
 * writeJbmTraceFileFrameWrapper()
 *
 *
 *---------------------------------------------------------------------*/

static ivas_error writeJbmTraceFileFrameWrapper(
    const void *data,
    void *writer )
{
    return JbmTraceFileWriter_writeFrame( data, writer );
}
@@ -3220,11 +3250,13 @@ static ivas_error decodeVoIP(
        fprintf( stderr, "\nError getting render frame size in samples\n" );
        return error;
    }

    if ( ( error = IVAS_DEC_GetRenderFramesizeSamples( hIvasDec, &nOutSamples ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError getting render frame size in samples\n" );
        return error;
    }

    if ( ( error = IVAS_DEC_GetReferencesUpdateFrequency( hIvasDec, &vec_pos_len ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError getting render frame size in samples\n" );
@@ -3266,8 +3298,8 @@ static ivas_error decodeVoIP(
        }
        fprintf( stdout, "JBM trace file:         %s\n", arg.jbmTraceFilename );
    }
#endif

#endif
    if ( arg.jbmOffsetFilename != NULL )
    {
        if ( ( error = JbmOffsetFileWriter_open( arg.jbmOffsetFilename, &jbmOffsetWriter ) ) != IVAS_ERR_OK )
@@ -3390,16 +3422,7 @@ static ivas_error decodeVoIP(
        {
            if ( headRotReader == NULL )
            {
                for ( i = 0; i < (int16_t) num_subframes; i++ )
                {
                    Quaternions[i].w = -3.0f;
                    Quaternions[i].x = 0.0f;
                    Quaternions[i].y = 0.0f;
                    Quaternions[i].z = 0.0f;
                    Pos[i].x = 0.0f;
                    Pos[i].y = 0.0f;
                    Pos[i].z = 0.0f;
                }
                resetHeadRotation( num_subframes, Quaternions, Pos );
            }
            else
            {
@@ -3407,8 +3430,7 @@ static ivas_error decodeVoIP(
                {
                    if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ),
                                 RotationFileReader_getFilePath( headRotReader ) );
                        fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) );
                        goto cleanup;
                    }
                }
@@ -3433,11 +3455,9 @@ static ivas_error decodeVoIP(

            for ( i = 0; i < (int16_t) num_subframes; i++ )
            {

                if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternions[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ),
                             RotationFileReader_getFilePath( externalOrientationFileReader ) );
                    fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( externalOrientationFileReader ) );
                    goto cleanup;
                }
            }
@@ -3754,6 +3774,7 @@ static ivas_error decodeVoIP(
                    {
                        fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                    }

                    if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -3807,10 +3828,9 @@ static ivas_error decodeVoIP(
#endif
    }


    int16_t nSamplesFlushed = 0;

    /* decode and get samples */
    /* flush remaining audio */
    if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -3826,7 +3846,7 @@ static ivas_error decodeVoIP(
            goto cleanup;
        }

        /* Write ISm metadata to external file(s) */
        /* Write ISM metadata to external file(s) */
        if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM )
@@ -3866,6 +3886,7 @@ static ivas_error decodeVoIP(
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }

                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
+1 −1
Original line number Diff line number Diff line
@@ -1336,7 +1336,6 @@ static bool parseCmdlIVAS_enc(
            ++i;
        }


        /*-----------------------------------------------------------------*
         * Complexity Level
         *-----------------------------------------------------------------*/
@@ -2236,6 +2235,7 @@ static bool readBitrate(

    fprintf( stderr, "Error: cannot read the bitrate profile file\n\n" );
    usage_enc();

    return false;
}

+11 −1
Original line number Diff line number Diff line
@@ -7,7 +7,17 @@

  <h2>Regression tracking</h2>

  <li><a href="long_term_regression.html">Long term regression</a></li>
  <ul>
    <li><a href="long_term_mld_enc.html">Long term MLD encoder</a></li>
    <li><a href="long_term_mld_dec.html">Long term MLD decoder</a></li>
    <li><a href="long_term_mld_dec_reject_JBM_BINAURAL_ROOM_REVERB.html">Long term MLD decoder - excluding JBM and BINAURAL_ROOM_REVERB</a></li>
    <li><a href="long_term_max_abs_diff_enc.html">Long term MAX_ABS_DIFF encoder</a></li>
    <li><a href="long_term_max_abs_diff_dec.html">Long term MAX_ABS_DIFF decoder</a></li>
    <li><a href="long_term_max_abs_diff_dec_reject_JBM_BINAURAL_ROOM_REVERB.html">Long term MAX_ABS_DIFF decoder - excluding JBM and BINAURAL_ROOM_REVERB</a></li>

    <li><a href="detect_regressions.html">Detect MLD regressions</a></li>
    <li><a href="detect_regressions.csv">detect_regressions.csv</a></li>
  </ul>

  <h2>Daily long testvector tests</h2>

+139 −71
Original line number Diff line number Diff line
#!/usr/bin/env python3

import os
import pandas as pd
import argparse
import plotly.express as px
import re
import plotly.graph_objects as go
from plotly.subplots import make_subplots

@@ -23,15 +25,18 @@ def read_csv_files(root_dir):


def parse_csv_data(csv_data):
    """keep 'testcase', 'format', 'MLD', 'MAX_ABS_DIFF'  and add
    'date' column."""
    cols_to_keep = ["testcase", "format", "MLD", "MAX_ABS_DIFF"]
    """keep 'testcase', 'format', 'MLD', 'MAX_ABS_DIFF', 'MIN_ODG', 'MIN_SSNR'  and add
    'date' and 'job' column."""
    cols_to_keep = ["testcase", "format", "MLD", "MAX_ABS_DIFF", "MIN_ODG", "MIN_SSNR"]
    parsed_data = {}
    for key, df in csv_data.items():
        tmp = key.split("-")
        job = "-".join(tmp[4:-4])
        cols = [col for col in cols_to_keep if col in df.columns]
        date = os.path.basename(os.path.dirname(key))
        new_df = df[cols].copy()
        new_df["date"] = date
        new_df["job"] = job
        parsed_data[key] = new_df

    # concatenate all dataframe in the dictionary
@@ -39,38 +44,67 @@ def parse_csv_data(csv_data):
    return concat_df


def plot_data(df, output_filename):
    """plot max values for 'MLD' and 'MAX_ABS_DIFF' data and save
def plot_data(df, args):
    """plot max values for measure and data and save
    to html file."""

    measure = args.measure
    days = args.days

    # Convert 'date' to datetime
    df["date"] = pd.to_datetime(df["date"], errors="coerce")
    df["MLD"] = pd.to_numeric(df["MLD"], errors="coerce")
    df["MAX_ABS_DIFF"] = pd.to_numeric(df["MAX_ABS_DIFF"], errors="coerce")
    df[measure] = pd.to_numeric(df[measure], errors="coerce")

    # Filter out rows older than "days"
    cutoff = df["date"].max() - pd.Timedelta(days=days)
    df = df[df["date"] > cutoff].reset_index(drop=True)

    # Drop rows with NaT and NaN
    clean_df = df.dropna(subset=["date", "MLD", "MAX_ABS_DIFF"])
    df = df.dropna(subset=["date", measure])

    # Filter test cases based on include/reject/match arguments
    if args.include:
        mask = pd.Series(False, index=df.index)
        for tag in args.include:
            mask |= df["testcase"].str.contains(tag, case=False, na=False)
        df = df[mask]
    if args.reject:
        mask = pd.Series(False, index=df.index)
        for tag in args.reject:
            mask |= df["testcase"].str.contains(tag, case=False, na=False)
        df = df[~mask]
    if args.match:
        pattern = re.compile(args.match, re.IGNORECASE)
        df = df[df["testcase"].str.contains(pattern, na=False)]

    # Filter jobs based on job-include/job-reject/job-match arguments
    if args.job_include:
        mask = pd.Series(False, index=df.index)
        for tag in args.job_include:
            mask |= df["job"].str.contains(tag, case=False, na=False)
        df = df[mask]
    if args.job_reject:
        mask = pd.Series(False, index=df.index)
        for tag in args.job_reject:
            mask |= df["job"].str.contains(tag, case=False, na=False)
        df = df[~mask]
    if args.job_match:
        pattern = re.compile(args.job_match, re.IGNORECASE)
        df = df[df["job"].str.contains(pattern, na=False)]

    # Group by 'format' and 'date' to get rows with max 'MLD' per group
    max_mld = (
        clean_df.groupby(["format", "date"])
        .apply(lambda x: x.loc[x["MLD"].idxmax()])
        .reset_index(drop=True)
    )

    # Group by 'format' and 'date' to get rows with max 'MAX_ABS_DIFF' per
    # group
    max_abs_diff = (
        clean_df.groupby(["format", "date"])
        .apply(lambda x: x.loc[x["MAX_ABS_DIFF"].idxmax()])
        .reset_index(drop=True)
    )
    # Group by 'format' and 'date' to get rows with max 'MLD' per group
    idx = df.groupby(["format", "date"])[measure].idxmax()
    max = df.loc[idx].reset_index(drop=True)
    idx = df.groupby(["format", "date"])[measure].idxmin()
    min = df.loc[idx].reset_index(drop=True)
    mean = df.groupby(["format", "date"])[measure].mean().to_frame("mean").reset_index()

    formats = sorted(clean_df["format"].unique())
    formats = sorted(df["format"].unique())

    fig = make_subplots(
        rows=5,
        cols=2,
        specs=[[{"secondary_y": True}] * 2] * 5,
        subplot_titles=[f"{i}" for i in formats],
        shared_xaxes="columns",
    )
@@ -79,64 +113,65 @@ def plot_data(df, output_filename):
        row = i // 2 + 1
        col = i % 2 + 1

        data_mld = max_mld[max_mld["format"] == fmt].sort_values("date")
        data_diff = max_abs_diff[max_abs_diff["format"]
                                 == fmt].sort_values("date")
        if "MIN" in measure:
            data = min[min["format"] == fmt].sort_values("date")
            maxmin_str = "Min"
        else:    
            data = max[max["format"] == fmt].sort_values("date")
            maxmin_str = "Max"

        # Add max 'MLD' to primary y-axis
        # Add max measure to plots
        fig.add_trace(
            go.Scatter(
                x=data_mld["date"],
                y=data_mld["MLD"],
                x=data["date"],
                y=data[measure],
                mode="lines+markers",
                name=f" {fmt} - Max MLD",
                name=f"{maxmin_str} {measure}",
                hovertext=[
                    f"Testcase: {tc}<br>MLD: {mld:.4f}<br>MAX_ABS_DIFF:"
                    f"{abs_diff}<br>Format:"
                    f" {format}<br>Date: {date.date()}"
                    for tc, mld, abs_diff, format, date in zip(
                        data_mld["testcase"],
                        data_mld["MLD"],
                        data_mld["MAX_ABS_DIFF"],
                        data_mld["format"],
                        data_mld["date"],
                    f"Testcase: {tc}<br>{maxmin_str} {measure}: {value:.4f}"
                    f"<br>Job: {job}"
                    f"<br>Date: {date.date()}"
                    for job, tc, value, date in zip(
                        data["job"],
                        data["testcase"],
                        data[measure],
                        data["date"],
                    )
                ],
                hoverinfo="text",
                marker_color="red",
                showlegend=(i == 0),
            ),
            row=row,
            col=col,
            secondary_y=False,
        )

        # Add max 'MAX_ABS_DIFF' to secondary y-axis
        data = mean[mean["format"] == fmt].sort_values("date")

        # Add mean measure to plots
        fig.add_trace(
            go.Scatter(
                x=data_diff["date"],
                y=data_diff["MAX_ABS_DIFF"],
                x=data["date"],
                y=data["mean"],
                mode="lines+markers",
                name=f"{fmt} - Max MAX_ABS_DIFF",
                name=f"Mean {measure}",
                hovertext=[
                    f"Testcase: {tc}<br>MLD: {mld:.4f}<br>MAX_ABS_DIFF:"
                    f" {abs_diff:.4f}<br>Format:"
                    f" {format}<br>Date: {date.date()}"
                    for tc, mld, abs_diff, format, date in zip(
                        data_diff["testcase"],
                        data_diff["MLD"],
                        data_diff["MAX_ABS_DIFF"],
                        data_diff["format"],
                        data_diff["date"],
                    f"Mean {measure}: {value:.4f}" f"<br>Date: {date.date()}"
                    for value, date in zip(
                        data["mean"],
                        data["date"],
                    )
                ],
                hoverinfo="text",
                marker_color="blue",
                showlegend=(i == 0),
            ),
            row=row,
            col=col,
            secondary_y=True,
        )

    fig.update_layout(
        title_text="Long-term regression: max MLD and max MAX_ABS_DIFF",
        title_text=f"History: {measure}",
        legend=dict(x=1, y=1, orientation="v"),
        hovermode="x unified",
    )
@@ -144,21 +179,8 @@ def plot_data(df, output_filename):
    fig.update_xaxes(automargin=True)
    fig.update_yaxes(automargin=True)

    # Update y-axes titles per subplot
    for i in range(10):
        yaxis_num = i * 2 + 1
        yaxis2_num = yaxis_num + 1
        fig["layout"][f"yaxis{yaxis_num}"].update(
            title="Max MLD", titlefont=dict(color="blue"), tickfont=dict(color="blue")
        )
        fig["layout"][f"yaxis{yaxis2_num}"].update(
            title="Max MAX_ABS_DIFF",
            titlefont=dict(color="green"),
            tickfont=dict(color="green"),
        )

    # Save to html
    fig.write_html(output_filename)
    fig.write_html(args.output_filename)


if __name__ == "__main__":
@@ -173,8 +195,54 @@ if __name__ == "__main__":
        type=str,
        help="Filename of the generated plot. e.g" ". long_term_regression.html",
    )
    parser.add_argument(
        "--days",
        type=int,
        help="Number of days in history. Default: 30",
        default=30,
    )
    parser.add_argument(
        "--measure",
        type=str,
        help="Measure for analysis: MLD, MAX_ABS_DIFF, MIN_ODG, MIN_SSNR, default: MLD",
        default="MLD",
    )
    parser.add_argument(
        "--include",
        nargs="+",
        type=str,
        help="List of tags to include in testcases",
    )
    parser.add_argument(
        "--reject",
        nargs="+",
        type=str,
        help="List of tags to reject in testcases",
    )
    parser.add_argument(
        "--match",
        type=str,
        help="Regex pattern for selecting testcases",
    )
    parser.add_argument(
        "--job-include",
        nargs="+",
        type=str,
        help="List of tags to include in jobs",
    )
    parser.add_argument(
        "--job-reject",
        nargs="+",
        type=str,
        help="List of tags to reject in jobs",
    )
    parser.add_argument(
        "--job-match",
        type=str,
        help="Regex pattern for selecting jobs",
    )
    args = parser.parse_args()

    csv_data = read_csv_files(args.root_dir)
    data = parse_csv_data(csv_data)
    plot_data(data, args.output_filename)
    plot_data(data, args)
+11 −28

File changed.

Preview size limit exceeded, changes collapsed.

Loading