Skip to content

Commit

Permalink
Simplify code per PR review
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Mendez <[email protected]>
  • Loading branch information
jonathanmendez committed Jun 8, 2023
1 parent 2cf01e6 commit 29da3db
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions examples/nidigital_spi/measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,15 @@ 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:
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)
def _get_file_name_from_path(file_path: Union[str, pathlib.PurePath]) -> str:
file_path = pathlib.PurePath(file_path)
return file_path.stem


Expand Down

0 comments on commit 29da3db

Please sign in to comment.