Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jwong-nd committed Nov 6, 2024
1 parent ba9dced commit a49d0db
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
14 changes: 8 additions & 6 deletions src/aind_behavior_video_transformation/etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)
from aind_behavior_video_transformation.transform_videos import (
CompressionRequest,
convert_video
convert_video,
)


Expand Down Expand Up @@ -50,8 +50,7 @@ class BehaviorVideoJobSettings(BasicJobSettings):
description="Run compression in parallel or sequentially.",
)
ffmpeg_thread_cnt: int = Field(
default=0,
description="Number of threads per ffmpeg compression job."
default=0, description="Number of threads per ffmpeg compression job."
)


Expand All @@ -76,7 +75,7 @@ class BehaviorVideoJob(GenericEtl[BehaviorVideoJobSettings]):

def _run_compression(
self,
convert_video_args: list[tuple[Path, Path, tuple[str, str] | None]]
convert_video_args: list[tuple[Path, Path, tuple[str, str] | None]],
) -> None:
"""
Runs CompressionRequests at the specified paths.
Expand All @@ -87,8 +86,11 @@ def _run_compression(
num_jobs = len(convert_video_args)
with ProcessPoolExecutor(max_workers=num_jobs) as executor:
jobs = [
executor.submit(convert_video, *params,
self.job_settings.ffmpeg_thread_cnt)
executor.submit(
convert_video,
*params,
self.job_settings.ffmpeg_thread_cnt,
)
for params in convert_video_args
]
for job in as_completed(jobs):
Expand Down
4 changes: 1 addition & 3 deletions src/aind_behavior_video_transformation/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from os.path import relpath
from pathlib import Path

from aind_behavior_video_transformation.transform_videos import convert_video


def likely_video_file(file: Path) -> bool:
"""
Expand Down Expand Up @@ -130,4 +128,4 @@ def transform_directory(
out_path = dst_dir / file_name
symlink(file_path, out_path)

return convert_video_args
return convert_video_args
2 changes: 1 addition & 1 deletion src/aind_behavior_video_transformation/transform_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def convert_video(
video_path: Path,
output_dir: Path,
arg_set: Optional[Tuple[str, str]],
ffmpeg_thread_cnt: int = 0
ffmpeg_thread_cnt: int = 0,
) -> Path:
"""
Converts a video to a specified format using ffmpeg.
Expand Down
3 changes: 0 additions & 3 deletions tests/test_transform_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ def helper_run_compression_job(job_settings, mock_time):
class TestBehaviorVideoJob(unittest.TestCase):
"""Test methods in BehaviorVideoJob class."""

# NOTE:
# Test suite does not run yet.
# Resolving lint errors first.
test_data_path = Path("tests/test_video_in_dir").resolve()
dummy_response = JobResponse(
status_code=200,
Expand Down

0 comments on commit a49d0db

Please sign in to comment.