From a67430fb4ebbbd12e0b8f37cdb5cec374f56bd69 Mon Sep 17 00:00:00 2001 From: Jonathan Mendez Date: Thu, 8 Jun 2023 11:51:49 -0500 Subject: [PATCH] Use timing and levels sheets name when applying rather than path (#282) * Use timing and levels sheets name when applying rather than path Signed-off-by: Jonathan Mendez * Simplify code per PR review Signed-off-by: Jonathan Mendez * Remove unnecessary helper function per PR review Signed-off-by: Jonathan Mendez --------- Signed-off-by: Jonathan Mendez --- examples/nidigital_spi/measurement.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/nidigital_spi/measurement.py b/examples/nidigital_spi/measurement.py index 20a419ea8..9c795f068 100644 --- a/examples/nidigital_spi/measurement.py +++ b/examples/nidigital_spi/measurement.py @@ -104,10 +104,9 @@ def measure( str(_resolve_relative_path(service_directory, pattern_file_path)), ) - selected_sites.apply_levels_and_timing( - str(_resolve_relative_path(service_directory, levels_file_path)), - str(_resolve_relative_path(service_directory, timing_file_path)), - ) + levels_file_name = pathlib.Path(levels_file_path).stem + timing_file_name = pathlib.Path(timing_file_path).stem + selected_sites.apply_levels_and_timing(levels_file_name, timing_file_name) selected_sites.burst_pattern(start_label="SPI_Pattern") site_pass_fail = selected_sites.get_site_pass_fail() passing_sites = [site for site, pass_fail in site_pass_fail.items() if pass_fail] @@ -151,8 +150,7 @@ def _create_nidigital_session( def _resolve_relative_path( directory_path: pathlib.Path, file_path: Union[str, pathlib.Path] ) -> pathlib.Path: - if not isinstance(file_path, pathlib.Path): - file_path = pathlib.Path(file_path) + file_path = pathlib.Path(file_path) if file_path.is_absolute(): return file_path else: