Loading tests/conftest.py +17 −11 Original line number Diff line number Diff line Loading @@ -580,11 +580,20 @@ class DecoderFrontend: raise ValueError(f'Wrong system "{system}"!') if not os.path.isfile(netsim_path): raise FileNotFoundError(f"network simulator binary {netsim_path} not found!\n") raise FileNotFoundError( f"network simulator binary {netsim_path} not found!\n" ) netsim_bitstream_path = input_bitstream_path.with_suffix(".netsimout") tracefile_path = input_bitstream_path.with_suffix(".netsimtrace") # TODO: need to check if the "1" works with every profile netsim_command = [netsim_path, netsim_profile, input_bitstream_path, netsim_bitstream_path, tracefile_path, "1"] netsim_command = [ netsim_path, netsim_profile, input_bitstream_path, netsim_bitstream_path, tracefile_path, "1", ] print(netsim_command) try: run(netsim_command, check=True, cwd=run_dir) Loading Loading @@ -862,15 +871,12 @@ def parse_properties(text_to_parse: str, output_differs: bool, props_to_record: props["MIN_SSNR"] = min_ssnr props["MIN_SSNR_CHANNEL"] = min_ssnr_channel elif prop == "ODG": odg_diffs = re.findall(ODG_PATTERN, text_to_parse) max_odg_diff = max(odg_diffs) max_odg_diff_channel = odg_diffs.index(max_odg_diff) props[ "MIN_ODG" ] = max_odg_diff props[ "MIN_ODG_CHANNEL" ] = max_odg_diff_channel odgs = re.findall(ODG_PATTERN, text_to_parse) print(odgs) min_odg = min(odgs) min_odg_channel = odgs.index(min_odg) props["MIN_ODG"] = min_odg props["MIN_ODG_CHANNEL"] = min_odg_channel return props Loading tests/constants.py +1 −1 Original line number Diff line number Diff line Loading @@ -8,5 +8,5 @@ TESTV_DIR = SCRIPTS_DIR.joinpath("testv") MLD_PATTERN = r"MLD: ([\d\.]*)" MAX_DIFF_PATTERN = r"MAXIMUM ABS DIFF: (\d*)" ODG_PATTERN_PQEVALAUDIO = r"Objective Difference Grade: (-*\d*\.\d*)" ODG_PATTERN = r"ODG diff: (-*\d*\.\d*)" ODG_PATTERN = r"ODG: (-*\d*\.\d*)" SSNR_PATTERN = r"Channel \d* SSNR: (nan|[+-]*inf|[\d\.]*)" Loading
tests/conftest.py +17 −11 Original line number Diff line number Diff line Loading @@ -580,11 +580,20 @@ class DecoderFrontend: raise ValueError(f'Wrong system "{system}"!') if not os.path.isfile(netsim_path): raise FileNotFoundError(f"network simulator binary {netsim_path} not found!\n") raise FileNotFoundError( f"network simulator binary {netsim_path} not found!\n" ) netsim_bitstream_path = input_bitstream_path.with_suffix(".netsimout") tracefile_path = input_bitstream_path.with_suffix(".netsimtrace") # TODO: need to check if the "1" works with every profile netsim_command = [netsim_path, netsim_profile, input_bitstream_path, netsim_bitstream_path, tracefile_path, "1"] netsim_command = [ netsim_path, netsim_profile, input_bitstream_path, netsim_bitstream_path, tracefile_path, "1", ] print(netsim_command) try: run(netsim_command, check=True, cwd=run_dir) Loading Loading @@ -862,15 +871,12 @@ def parse_properties(text_to_parse: str, output_differs: bool, props_to_record: props["MIN_SSNR"] = min_ssnr props["MIN_SSNR_CHANNEL"] = min_ssnr_channel elif prop == "ODG": odg_diffs = re.findall(ODG_PATTERN, text_to_parse) max_odg_diff = max(odg_diffs) max_odg_diff_channel = odg_diffs.index(max_odg_diff) props[ "MIN_ODG" ] = max_odg_diff props[ "MIN_ODG_CHANNEL" ] = max_odg_diff_channel odgs = re.findall(ODG_PATTERN, text_to_parse) print(odgs) min_odg = min(odgs) min_odg_channel = odgs.index(min_odg) props["MIN_ODG"] = min_odg props["MIN_ODG_CHANNEL"] = min_odg_channel return props Loading
tests/constants.py +1 −1 Original line number Diff line number Diff line Loading @@ -8,5 +8,5 @@ TESTV_DIR = SCRIPTS_DIR.joinpath("testv") MLD_PATTERN = r"MLD: ([\d\.]*)" MAX_DIFF_PATTERN = r"MAXIMUM ABS DIFF: (\d*)" ODG_PATTERN_PQEVALAUDIO = r"Objective Difference Grade: (-*\d*\.\d*)" ODG_PATTERN = r"ODG diff: (-*\d*\.\d*)" ODG_PATTERN = r"ODG: (-*\d*\.\d*)" SSNR_PATTERN = r"Channel \d* SSNR: (nan|[+-]*inf|[\d\.]*)"