Loading tests/codec_be_on_mr_nonselection/test_param_file.py +8 −3 Original line number Diff line number Diff line Loading @@ -593,7 +593,6 @@ def run_test( fs = int(sampling_rate) * 1000 pytest.set_trace() split_idx = np.empty(0) if split_comparison: split_idx = get_split_idx(str(Path(testv_file).stem), int(sampling_rate)) Loading @@ -619,8 +618,14 @@ def run_test( split_idx=split_idx, ) for output_differs, reason in zip(output_differs_parts, reason_parts): props = parse_properties(reason, output_differs, props_to_record) prop_suffix = [""] if len(split_idx) > 0: prop_suffix = [f"_split{i}" for i in range(1, len(split_idx) + 1)] for output_differs, reason, suffix in zip( output_differs_parts, reason_parts, prop_suffix ): props = parse_properties(reason, output_differs, props_to_record, suffix) for k, v in props.items(): dut_decoder_frontend.record_property(k, v) Loading tests/conftest.py +12 −10 Original line number Diff line number Diff line Loading @@ -1169,7 +1169,9 @@ def props_to_record( return props def parse_properties(text_to_parse: str, output_differs: bool, props_to_record: list): def parse_properties( text_to_parse: str, output_differs: bool, props_to_record: list, suffix: str = "" ): """ Record the given properties in the report by parsing their values from the text. """ Loading @@ -1179,7 +1181,7 @@ def parse_properties(text_to_parse: str, output_differs: bool, props_to_record: for prop in props_to_record: if prop == MLD or prop == DMX_MLD: mld = float(re.search(MLD_PATTERN, text_to_parse).groups(1)[0]) props[prop] = mld props[prop + suffix] = mld elif prop == MAX_ABS_DIFF or prop == DMX_DIFF: max_diff = 0 if output_differs: Loading @@ -1187,33 +1189,33 @@ def parse_properties(text_to_parse: str, output_differs: bool, props_to_record: max_diff = match.groups(1)[0] else: raise MaxDiffPatternNotFound() props[prop] = max_diff props[prop + suffix] = max_diff elif prop == SSNR or prop == DMX_SSNR: ssnrs = re.findall(SSNR_PATTERN, text_to_parse) min_ssnr = min(ssnrs) min_ssnr_channel = ssnrs.index(min_ssnr) prefix = "MIN" if prop == SSNR else "DMX" props[f"{prefix}_SSNR"] = min_ssnr props[f"{prefix}_SSNR_CHANNEL"] = min_ssnr_channel props[f"{prefix}_SSNR" + suffix] = min_ssnr props[f"{prefix}_SSNR_CHANNEL" + suffix] = min_ssnr_channel elif prop == ODG: odgs = re.findall(ODG_PATTERN, text_to_parse) min_odg = min(odgs) min_odg_channel = odgs.index(min_odg) props["MIN_ODG"] = min_odg props["MIN_ODG_CHANNEL"] = min_odg_channel props["MIN_ODG" + suffix] = min_odg props["MIN_ODG_CHANNEL" + suffix] = min_odg_channel elif prop == MAX_ENC_DIFF: search_result = re.search(MAX_ENC_DIFF_PATTERN, text_to_parse) max_enc_diff_ratio = 0.0 max_enc_diff_param_name = "" if search_result: max_enc_diff_param_name, _, max_enc_diff_ratio = search_result.groups(0) props[MAX_ENC_DIFF] = float(max_enc_diff_ratio) props[MAX_ENC_DIFF_PARAM_NAME] = max_enc_diff_param_name props[MAX_ENC_DIFF + suffix] = float(max_enc_diff_ratio) props[MAX_ENC_DIFF_PARAM_NAME + suffix] = max_enc_diff_param_name elif prop == DELTA_ODG: delta_odg = re.search(DELTA_ODG_PATTERN, text_to_parse) if delta_odg: props["DELTA_ODG"] = delta_odg.groups(1)[0] props["DELTA_ODG" + suffix] = delta_odg.groups(1)[0] return props Loading Loading
tests/codec_be_on_mr_nonselection/test_param_file.py +8 −3 Original line number Diff line number Diff line Loading @@ -593,7 +593,6 @@ def run_test( fs = int(sampling_rate) * 1000 pytest.set_trace() split_idx = np.empty(0) if split_comparison: split_idx = get_split_idx(str(Path(testv_file).stem), int(sampling_rate)) Loading @@ -619,8 +618,14 @@ def run_test( split_idx=split_idx, ) for output_differs, reason in zip(output_differs_parts, reason_parts): props = parse_properties(reason, output_differs, props_to_record) prop_suffix = [""] if len(split_idx) > 0: prop_suffix = [f"_split{i}" for i in range(1, len(split_idx) + 1)] for output_differs, reason, suffix in zip( output_differs_parts, reason_parts, prop_suffix ): props = parse_properties(reason, output_differs, props_to_record, suffix) for k, v in props.items(): dut_decoder_frontend.record_property(k, v) Loading
tests/conftest.py +12 −10 Original line number Diff line number Diff line Loading @@ -1169,7 +1169,9 @@ def props_to_record( return props def parse_properties(text_to_parse: str, output_differs: bool, props_to_record: list): def parse_properties( text_to_parse: str, output_differs: bool, props_to_record: list, suffix: str = "" ): """ Record the given properties in the report by parsing their values from the text. """ Loading @@ -1179,7 +1181,7 @@ def parse_properties(text_to_parse: str, output_differs: bool, props_to_record: for prop in props_to_record: if prop == MLD or prop == DMX_MLD: mld = float(re.search(MLD_PATTERN, text_to_parse).groups(1)[0]) props[prop] = mld props[prop + suffix] = mld elif prop == MAX_ABS_DIFF or prop == DMX_DIFF: max_diff = 0 if output_differs: Loading @@ -1187,33 +1189,33 @@ def parse_properties(text_to_parse: str, output_differs: bool, props_to_record: max_diff = match.groups(1)[0] else: raise MaxDiffPatternNotFound() props[prop] = max_diff props[prop + suffix] = max_diff elif prop == SSNR or prop == DMX_SSNR: ssnrs = re.findall(SSNR_PATTERN, text_to_parse) min_ssnr = min(ssnrs) min_ssnr_channel = ssnrs.index(min_ssnr) prefix = "MIN" if prop == SSNR else "DMX" props[f"{prefix}_SSNR"] = min_ssnr props[f"{prefix}_SSNR_CHANNEL"] = min_ssnr_channel props[f"{prefix}_SSNR" + suffix] = min_ssnr props[f"{prefix}_SSNR_CHANNEL" + suffix] = min_ssnr_channel elif prop == ODG: odgs = re.findall(ODG_PATTERN, text_to_parse) min_odg = min(odgs) min_odg_channel = odgs.index(min_odg) props["MIN_ODG"] = min_odg props["MIN_ODG_CHANNEL"] = min_odg_channel props["MIN_ODG" + suffix] = min_odg props["MIN_ODG_CHANNEL" + suffix] = min_odg_channel elif prop == MAX_ENC_DIFF: search_result = re.search(MAX_ENC_DIFF_PATTERN, text_to_parse) max_enc_diff_ratio = 0.0 max_enc_diff_param_name = "" if search_result: max_enc_diff_param_name, _, max_enc_diff_ratio = search_result.groups(0) props[MAX_ENC_DIFF] = float(max_enc_diff_ratio) props[MAX_ENC_DIFF_PARAM_NAME] = max_enc_diff_param_name props[MAX_ENC_DIFF + suffix] = float(max_enc_diff_ratio) props[MAX_ENC_DIFF_PARAM_NAME + suffix] = max_enc_diff_param_name elif prop == DELTA_ODG: delta_odg = re.search(DELTA_ODG_PATTERN, text_to_parse) if delta_odg: props["DELTA_ODG"] = delta_odg.groups(1)[0] props["DELTA_ODG" + suffix] = delta_odg.groups(1)[0] return props Loading