Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Brozdowski <[email protected]>
  • Loading branch information
edeno and CBroz1 authored Feb 20, 2024
1 parent 4ba8878 commit b8abd47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/spyglass/position/v1/dlc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def _convert_mp4(
f"{dest_path.as_posix()}",
]
if dest_path.exists():
print(f"{dest_path} already exists, skipping conversion")
logger.info(f"{dest_path} already exists, skipping conversion")
else:
try:
sys.stdout.flush()
Expand All @@ -555,9 +555,9 @@ def _convert_mp4(
f"command {err.cmd} return with error (code {err.returncode}): {err.output}"
) from err
out, _ = convert_process.communicate()
print(out.decode("utf-8"))
print(f"finished converting {filename}")
print(
logger.info(out.decode("utf-8"))
logger.info(f"finished converting {filename}")
logger.info(
f"Checking that number of packets match between {orig_filename} and {dest_filename}"
)
num_packets = []
Expand Down
14 changes: 6 additions & 8 deletions src/spyglass/position/v1/position_dlc_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,12 @@ def add_video_files(
video_filename = video.rsplit(
video_path.as_posix(), maxsplit=1
)[-1].split("/")[-1]
videos.extend(
[
check_videofile(
video_path=video_path,
output_path=output_path,
video_filename=video_filename,
)[0].as_posix()
]
videos.append(
check_videofile(
video_path=video_path,
output_path=output_path,
video_filename=video_filename,
)[0].as_posix()
)
if len(videos) < 1:
raise ValueError(f"no .mp4 videos found in{video_path}")
Expand Down

0 comments on commit b8abd47

Please sign in to comment.