Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use timing and levels sheets name when applying rather than path #282

Merged
merged 3 commits into from
Jun 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions examples/nidigital_spi/measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = _get_file_name_from_path(levels_file_path)
timing_file_name = _get_file_name_from_path(timing_file_path)
jonathanmendez marked this conversation as resolved.
Show resolved Hide resolved
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]
Expand Down Expand Up @@ -159,6 +158,12 @@ def _resolve_relative_path(
return (directory_path / file_path).resolve()


def _get_file_name_from_path(file_path: Union[str, pathlib.Path]) -> str:
if not isinstance(file_path, pathlib.Path):
file_path = pathlib.Path(file_path)
jonathanmendez marked this conversation as resolved.
Show resolved Hide resolved
return file_path.stem


@click.command
@verbosity_option
@grpc_device_options
Expand Down