From 3f9eed1bef793f0f47b3001d22e6c9174ccf901d Mon Sep 17 00:00:00 2001 From: Valentin Zulkower Date: Tue, 19 Nov 2024 22:28:12 -0500 Subject: [PATCH] applied isort --- docs/conf.py | 1 + moviepy/Clip.py | 2 +- moviepy/Effect.py | 3 ++- moviepy/__init__.py | 9 ++++--- moviepy/audio/fx/AudioDelay.py | 6 ++--- moviepy/audio/fx/AudioFadeIn.py | 8 +++--- moviepy/audio/fx/AudioFadeOut.py | 8 +++--- moviepy/audio/fx/AudioLoop.py | 6 ++--- moviepy/audio/fx/AudioNormalize.py | 6 ++--- moviepy/audio/fx/MultiplyStereoVolume.py | 4 +-- moviepy/audio/fx/MultiplyVolume.py | 8 +++--- moviepy/tools.py | 2 +- moviepy/video/VideoClip.py | 25 +++++++------------ .../video/compositing/CompositeVideoClip.py | 3 ++- moviepy/video/fx/AccelDecel.py | 3 ++- moviepy/video/fx/BlackAndWhite.py | 4 ++- moviepy/video/fx/Blink.py | 3 ++- moviepy/video/fx/Crop.py | 3 ++- moviepy/video/fx/CrossFadeIn.py | 4 +-- moviepy/video/fx/CrossFadeOut.py | 4 +-- moviepy/video/fx/EvenSize.py | 3 ++- moviepy/video/fx/FadeIn.py | 4 +-- moviepy/video/fx/FadeOut.py | 3 ++- moviepy/video/fx/Freeze.py | 4 +-- moviepy/video/fx/FreezeRegion.py | 6 ++--- moviepy/video/fx/GammaCorrection.py | 3 ++- moviepy/video/fx/HeadBlur.py | 4 ++- moviepy/video/fx/InvertColors.py | 3 ++- moviepy/video/fx/Loop.py | 3 ++- moviepy/video/fx/LumContrast.py | 3 ++- moviepy/video/fx/MakeLoopable.py | 4 +-- moviepy/video/fx/Margin.py | 8 +++--- moviepy/video/fx/MaskColor.py | 3 ++- moviepy/video/fx/MasksAnd.py | 8 +++--- moviepy/video/fx/MasksOr.py | 8 +++--- moviepy/video/fx/MirrorX.py | 5 ++-- moviepy/video/fx/MirrorY.py | 5 ++-- moviepy/video/fx/MultiplyColor.py | 4 ++- moviepy/video/fx/MultiplySpeed.py | 3 ++- moviepy/video/fx/Painting.py | 3 ++- moviepy/video/fx/Resize.py | 8 +++--- moviepy/video/fx/Rotate.py | 3 ++- moviepy/video/fx/SlideIn.py | 3 ++- moviepy/video/fx/SlideOut.py | 3 ++- moviepy/video/fx/SuperSample.py | 3 ++- moviepy/video/fx/TimeMirror.py | 3 ++- moviepy/video/fx/TimeSymmetrize.py | 3 ++- moviepy/video/fx/__init__.py | 2 +- moviepy/video/io/gif_writers.py | 3 ++- setup.py | 3 ++- tests/conftest.py | 2 +- tests/test_compositing.py | 3 +++ tests/test_doc_examples.py | 9 +++---- tests/test_tools.py | 2 +- tests/test_videotools.py | 2 +- 55 files changed, 140 insertions(+), 111 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 2e27551c2..6861f340b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -8,6 +8,7 @@ import pydata_sphinx_theme from pygments.styles import get_all_styles + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. diff --git a/moviepy/Clip.py b/moviepy/Clip.py index 830a176a0..7f30fed31 100644 --- a/moviepy/Clip.py +++ b/moviepy/Clip.py @@ -6,11 +6,11 @@ from functools import reduce from numbers import Real from operator import add +from typing import TYPE_CHECKING, List import numpy as np import proglog -from typing import List, TYPE_CHECKING if TYPE_CHECKING: from moviepy.Effect import Effect diff --git a/moviepy/Effect.py b/moviepy/Effect.py index 9cdb2dcd4..7f1fdb3dd 100644 --- a/moviepy/Effect.py +++ b/moviepy/Effect.py @@ -1,6 +1,7 @@ +import copy as _copy from abc import ABCMeta, abstractmethod + from moviepy.Clip import Clip -import copy as _copy class Effect(metaclass=ABCMeta): diff --git a/moviepy/__init__.py b/moviepy/__init__.py index 45acfc4c6..2d4d60c74 100644 --- a/moviepy/__init__.py +++ b/moviepy/__init__.py @@ -4,12 +4,13 @@ from moviepy.audio import fx as afx from moviepy.audio.AudioClip import ( + AudioArrayClip, AudioClip, CompositeAudioClip, - AudioArrayClip, concatenate_audioclips, ) from moviepy.audio.io.AudioFileClip import AudioFileClip +from moviepy.Effect import Effect from moviepy.tools import convert_to_seconds from moviepy.version import __version__ from moviepy.video import fx as vfx, tools as videotools @@ -22,17 +23,17 @@ from moviepy.video.io.display_in_notebook import display_in_notebook from moviepy.video.io.ImageSequenceClip import ImageSequenceClip from moviepy.video.io.VideoFileClip import VideoFileClip -from moviepy.Effect import Effect from moviepy.video.VideoClip import ( BitmapClip, ColorClip, + DataVideoClip, ImageClip, TextClip, - VideoClip, - DataVideoClip, UpdatedVideoClip, + VideoClip, ) + # Add display in notebook to video and audioclip VideoClip.display_in_notebook = display_in_notebook AudioClip.display_in_notebook = display_in_notebook diff --git a/moviepy/audio/fx/AudioDelay.py b/moviepy/audio/fx/AudioDelay.py index 691fe5dbb..fccde9d97 100644 --- a/moviepy/audio/fx/AudioDelay.py +++ b/moviepy/audio/fx/AudioDelay.py @@ -1,12 +1,12 @@ +from dataclasses import dataclass + import numpy as np from moviepy.audio.AudioClip import CompositeAudioClip from moviepy.audio.fx.MultiplyVolume import MultiplyVolume -from moviepy.decorators import audio_video_effect - from moviepy.Clip import Clip +from moviepy.decorators import audio_video_effect from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/audio/fx/AudioFadeIn.py b/moviepy/audio/fx/AudioFadeIn.py index 5b5f1e74c..7ade56d77 100644 --- a/moviepy/audio/fx/AudioFadeIn.py +++ b/moviepy/audio/fx/AudioFadeIn.py @@ -1,11 +1,11 @@ -import numpy as np +from dataclasses import dataclass -from moviepy.decorators import audio_video_effect -from moviepy.tools import convert_to_seconds +import numpy as np from moviepy.Clip import Clip +from moviepy.decorators import audio_video_effect from moviepy.Effect import Effect -from dataclasses import dataclass +from moviepy.tools import convert_to_seconds @dataclass diff --git a/moviepy/audio/fx/AudioFadeOut.py b/moviepy/audio/fx/AudioFadeOut.py index 8dcd524ac..6d1e18e70 100644 --- a/moviepy/audio/fx/AudioFadeOut.py +++ b/moviepy/audio/fx/AudioFadeOut.py @@ -1,11 +1,11 @@ -import numpy as np +from dataclasses import dataclass -from moviepy.decorators import audio_video_effect -from moviepy.tools import convert_to_seconds +import numpy as np from moviepy.Clip import Clip +from moviepy.decorators import audio_video_effect from moviepy.Effect import Effect -from dataclasses import dataclass +from moviepy.tools import convert_to_seconds @dataclass diff --git a/moviepy/audio/fx/AudioLoop.py b/moviepy/audio/fx/AudioLoop.py index 2de9169c6..0acb96db0 100644 --- a/moviepy/audio/fx/AudioLoop.py +++ b/moviepy/audio/fx/AudioLoop.py @@ -1,9 +1,9 @@ -from moviepy.audio.AudioClip import concatenate_audioclips -from moviepy.decorators import audio_video_effect +from dataclasses import dataclass +from moviepy.audio.AudioClip import concatenate_audioclips from moviepy.Clip import Clip +from moviepy.decorators import audio_video_effect from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/audio/fx/AudioNormalize.py b/moviepy/audio/fx/AudioNormalize.py index e6e03c2d4..6e496946d 100644 --- a/moviepy/audio/fx/AudioNormalize.py +++ b/moviepy/audio/fx/AudioNormalize.py @@ -1,9 +1,9 @@ -from moviepy.audio.fx.MultiplyVolume import MultiplyVolume -from moviepy.decorators import audio_video_effect +from dataclasses import dataclass +from moviepy.audio.fx.MultiplyVolume import MultiplyVolume from moviepy.Clip import Clip +from moviepy.decorators import audio_video_effect from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/audio/fx/MultiplyStereoVolume.py b/moviepy/audio/fx/MultiplyStereoVolume.py index 022447efb..c0a8b523a 100644 --- a/moviepy/audio/fx/MultiplyStereoVolume.py +++ b/moviepy/audio/fx/MultiplyStereoVolume.py @@ -1,8 +1,8 @@ -from moviepy.decorators import audio_video_effect +from dataclasses import dataclass from moviepy.Clip import Clip +from moviepy.decorators import audio_video_effect from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/audio/fx/MultiplyVolume.py b/moviepy/audio/fx/MultiplyVolume.py index f8519f0f0..6c8229563 100644 --- a/moviepy/audio/fx/MultiplyVolume.py +++ b/moviepy/audio/fx/MultiplyVolume.py @@ -1,11 +1,11 @@ -import numpy as np +from dataclasses import dataclass -from moviepy.decorators import audio_video_effect -from moviepy.tools import convert_to_seconds +import numpy as np from moviepy.Clip import Clip +from moviepy.decorators import audio_video_effect from moviepy.Effect import Effect -from dataclasses import dataclass +from moviepy.tools import convert_to_seconds @dataclass diff --git a/moviepy/tools.py b/moviepy/tools.py index 9656c244a..9fe74b0d0 100644 --- a/moviepy/tools.py +++ b/moviepy/tools.py @@ -1,11 +1,11 @@ """Misc. useful functions that can be used at many places in the program.""" import os +import platform import subprocess as sp import warnings import proglog -import platform OS_NAME = os.name diff --git a/moviepy/video/VideoClip.py b/moviepy/video/VideoClip.py index 884262a46..2c22ef81e 100644 --- a/moviepy/video/VideoClip.py +++ b/moviepy/video/VideoClip.py @@ -6,28 +6,23 @@ import copy as _copy import os +import threading from numbers import Real +from typing import TYPE_CHECKING, List, Union import numpy as np import proglog -from imageio.v3 import imread, imwrite from imageio.v2 import imread as imread_v2 +from imageio.v3 import imread, imwrite from PIL import Image, ImageDraw, ImageFont -import threading from moviepy.video.io.ffplay_previewer import ffplay_preview_video -from typing import Union, List, TYPE_CHECKING if TYPE_CHECKING: from moviepy.Effect import Effect -from moviepy.video.fx.Resize import Resize -from moviepy.video.fx.Rotate import Rotate -from moviepy.video.fx.Crop import Crop from moviepy.audio.fx.MultiplyVolume import MultiplyVolume -from moviepy.video.fx.MultiplySpeed import MultiplySpeed - from moviepy.Clip import Clip from moviepy.decorators import ( add_mask_if_none, @@ -40,15 +35,13 @@ requires_fps, use_clip_fps_by_default, ) - -from moviepy.tools import ( - extensions_dict, - find_extension, -) +from moviepy.tools import extensions_dict, find_extension +from moviepy.video.fx.Crop import Crop +from moviepy.video.fx.MultiplySpeed import MultiplySpeed +from moviepy.video.fx.Resize import Resize +from moviepy.video.fx.Rotate import Rotate from moviepy.video.io.ffmpeg_writer import ffmpeg_write_video -from moviepy.video.io.gif_writers import ( - write_gif_with_imageio, -) +from moviepy.video.io.gif_writers import write_gif_with_imageio from moviepy.video.tools.drawing import blit diff --git a/moviepy/video/compositing/CompositeVideoClip.py b/moviepy/video/compositing/CompositeVideoClip.py index 0110bb161..99752d312 100644 --- a/moviepy/video/compositing/CompositeVideoClip.py +++ b/moviepy/video/compositing/CompositeVideoClip.py @@ -1,8 +1,9 @@ """Main video composition interface of MoviePy.""" +from functools import reduce + import numpy as np from PIL import Image -from functools import reduce from moviepy.audio.AudioClip import CompositeAudioClip from moviepy.video.VideoClip import ColorClip, VideoClip diff --git a/moviepy/video/fx/AccelDecel.py b/moviepy/video/fx/AccelDecel.py index ad89e9ec7..a8b146988 100644 --- a/moviepy/video/fx/AccelDecel.py +++ b/moviepy/video/fx/AccelDecel.py @@ -1,6 +1,7 @@ -from moviepy.Effect import Effect from dataclasses import dataclass +from moviepy.Effect import Effect + @dataclass class AccelDecel(Effect): diff --git a/moviepy/video/fx/BlackAndWhite.py b/moviepy/video/fx/BlackAndWhite.py index fd473b7c6..604b778e6 100644 --- a/moviepy/video/fx/BlackAndWhite.py +++ b/moviepy/video/fx/BlackAndWhite.py @@ -1,6 +1,8 @@ +from dataclasses import dataclass + import numpy as np + from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/Blink.py b/moviepy/video/fx/Blink.py index 57be1d2d9..726ce0873 100644 --- a/moviepy/video/fx/Blink.py +++ b/moviepy/video/fx/Blink.py @@ -1,6 +1,7 @@ -from moviepy.Effect import Effect from dataclasses import dataclass +from moviepy.Effect import Effect + @dataclass class Blink(Effect): diff --git a/moviepy/video/fx/Crop.py b/moviepy/video/fx/Crop.py index f38772f11..498a373dd 100644 --- a/moviepy/video/fx/Crop.py +++ b/moviepy/video/fx/Crop.py @@ -1,6 +1,7 @@ +from dataclasses import dataclass + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/CrossFadeIn.py b/moviepy/video/fx/CrossFadeIn.py index b130861a1..d8881bd63 100644 --- a/moviepy/video/fx/CrossFadeIn.py +++ b/moviepy/video/fx/CrossFadeIn.py @@ -1,7 +1,7 @@ -from moviepy.Clip import Clip -from moviepy.Effect import Effect from dataclasses import dataclass +from moviepy.Clip import Clip +from moviepy.Effect import Effect from moviepy.video.fx.FadeIn import FadeIn diff --git a/moviepy/video/fx/CrossFadeOut.py b/moviepy/video/fx/CrossFadeOut.py index a05e44b0c..038413093 100644 --- a/moviepy/video/fx/CrossFadeOut.py +++ b/moviepy/video/fx/CrossFadeOut.py @@ -1,7 +1,7 @@ -from moviepy.Clip import Clip -from moviepy.Effect import Effect from dataclasses import dataclass +from moviepy.Clip import Clip +from moviepy.Effect import Effect from moviepy.video.fx.FadeOut import FadeOut diff --git a/moviepy/video/fx/EvenSize.py b/moviepy/video/fx/EvenSize.py index f027ebdff..e024c8310 100644 --- a/moviepy/video/fx/EvenSize.py +++ b/moviepy/video/fx/EvenSize.py @@ -1,6 +1,7 @@ +from dataclasses import dataclass + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/FadeIn.py b/moviepy/video/fx/FadeIn.py index a51075cf1..9a5746b42 100644 --- a/moviepy/video/fx/FadeIn.py +++ b/moviepy/video/fx/FadeIn.py @@ -1,9 +1,9 @@ -import numpy as np +from dataclasses import dataclass +import numpy as np from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/FadeOut.py b/moviepy/video/fx/FadeOut.py index 3338e594f..75b47ee8f 100644 --- a/moviepy/video/fx/FadeOut.py +++ b/moviepy/video/fx/FadeOut.py @@ -1,8 +1,9 @@ +from dataclasses import dataclass + import numpy as np from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/Freeze.py b/moviepy/video/fx/Freeze.py index 35be3decd..ebaf75529 100644 --- a/moviepy/video/fx/Freeze.py +++ b/moviepy/video/fx/Freeze.py @@ -1,8 +1,8 @@ -from moviepy.video.compositing.CompositeVideoClip import concatenate_videoclips +from dataclasses import dataclass from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass +from moviepy.video.compositing.CompositeVideoClip import concatenate_videoclips @dataclass diff --git a/moviepy/video/fx/FreezeRegion.py b/moviepy/video/fx/FreezeRegion.py index c34d4a3a8..02305ad51 100644 --- a/moviepy/video/fx/FreezeRegion.py +++ b/moviepy/video/fx/FreezeRegion.py @@ -1,9 +1,9 @@ -from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip -from moviepy.video.fx.Crop import Crop +from dataclasses import dataclass from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass +from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip +from moviepy.video.fx.Crop import Crop @dataclass diff --git a/moviepy/video/fx/GammaCorrection.py b/moviepy/video/fx/GammaCorrection.py index 14a6696e2..df81a4f5d 100644 --- a/moviepy/video/fx/GammaCorrection.py +++ b/moviepy/video/fx/GammaCorrection.py @@ -1,6 +1,7 @@ +from dataclasses import dataclass + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/HeadBlur.py b/moviepy/video/fx/HeadBlur.py index 837787d52..f22fc399e 100644 --- a/moviepy/video/fx/HeadBlur.py +++ b/moviepy/video/fx/HeadBlur.py @@ -1,8 +1,10 @@ +from dataclasses import dataclass + import numpy as np from PIL import Image, ImageDraw, ImageFilter + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/InvertColors.py b/moviepy/video/fx/InvertColors.py index 8952fd576..3df536fef 100644 --- a/moviepy/video/fx/InvertColors.py +++ b/moviepy/video/fx/InvertColors.py @@ -1,6 +1,7 @@ +from dataclasses import dataclass + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/Loop.py b/moviepy/video/fx/Loop.py index d0ccde9dc..e283569f8 100644 --- a/moviepy/video/fx/Loop.py +++ b/moviepy/video/fx/Loop.py @@ -1,6 +1,7 @@ +from dataclasses import dataclass + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/LumContrast.py b/moviepy/video/fx/LumContrast.py index 8db120652..4ada93b89 100644 --- a/moviepy/video/fx/LumContrast.py +++ b/moviepy/video/fx/LumContrast.py @@ -1,6 +1,7 @@ +from dataclasses import dataclass + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/MakeLoopable.py b/moviepy/video/fx/MakeLoopable.py index 106fe64ca..c8ada8348 100644 --- a/moviepy/video/fx/MakeLoopable.py +++ b/moviepy/video/fx/MakeLoopable.py @@ -1,9 +1,9 @@ -from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip +from dataclasses import dataclass from moviepy.Clip import Clip from moviepy.Effect import Effect +from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip from moviepy.video.fx.CrossFadeIn import CrossFadeIn -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/Margin.py b/moviepy/video/fx/Margin.py index 8d5489b0f..4f6f8dbbd 100644 --- a/moviepy/video/fx/Margin.py +++ b/moviepy/video/fx/Margin.py @@ -1,11 +1,11 @@ -import numpy as np +from dataclasses import dataclass -from moviepy.decorators import apply_to_mask -from moviepy.video.VideoClip import ImageClip +import numpy as np from moviepy.Clip import Clip +from moviepy.decorators import apply_to_mask from moviepy.Effect import Effect -from dataclasses import dataclass +from moviepy.video.VideoClip import ImageClip @dataclass diff --git a/moviepy/video/fx/MaskColor.py b/moviepy/video/fx/MaskColor.py index 2ef32a1c8..cdd24aecd 100644 --- a/moviepy/video/fx/MaskColor.py +++ b/moviepy/video/fx/MaskColor.py @@ -1,8 +1,9 @@ +from dataclasses import dataclass + import numpy as np from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/MasksAnd.py b/moviepy/video/fx/MasksAnd.py index 6c355a7e5..bd7b4e3b4 100644 --- a/moviepy/video/fx/MasksAnd.py +++ b/moviepy/video/fx/MasksAnd.py @@ -1,11 +1,11 @@ -import numpy as np +from dataclasses import dataclass +from typing import Union -from moviepy.video.VideoClip import ImageClip +import numpy as np from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass -from typing import Union +from moviepy.video.VideoClip import ImageClip @dataclass diff --git a/moviepy/video/fx/MasksOr.py b/moviepy/video/fx/MasksOr.py index 9d755a7d7..22c30b1ac 100644 --- a/moviepy/video/fx/MasksOr.py +++ b/moviepy/video/fx/MasksOr.py @@ -1,11 +1,11 @@ -import numpy as np +from dataclasses import dataclass +from typing import Union -from moviepy.video.VideoClip import ImageClip +import numpy as np from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass -from typing import Union +from moviepy.video.VideoClip import ImageClip @dataclass diff --git a/moviepy/video/fx/MirrorX.py b/moviepy/video/fx/MirrorX.py index 2e44b0ac2..becbe1799 100644 --- a/moviepy/video/fx/MirrorX.py +++ b/moviepy/video/fx/MirrorX.py @@ -1,7 +1,8 @@ +from dataclasses import dataclass +from typing import List, Union + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass -from typing import Union, List @dataclass diff --git a/moviepy/video/fx/MirrorY.py b/moviepy/video/fx/MirrorY.py index 38380c271..e96c9b77e 100644 --- a/moviepy/video/fx/MirrorY.py +++ b/moviepy/video/fx/MirrorY.py @@ -1,7 +1,8 @@ +from dataclasses import dataclass +from typing import List, Union + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass -from typing import Union, List @dataclass diff --git a/moviepy/video/fx/MultiplyColor.py b/moviepy/video/fx/MultiplyColor.py index 7da8ebb30..4976f8dbf 100644 --- a/moviepy/video/fx/MultiplyColor.py +++ b/moviepy/video/fx/MultiplyColor.py @@ -1,7 +1,9 @@ +from dataclasses import dataclass + import numpy as np + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/MultiplySpeed.py b/moviepy/video/fx/MultiplySpeed.py index ce61f3b42..72c9558e8 100644 --- a/moviepy/video/fx/MultiplySpeed.py +++ b/moviepy/video/fx/MultiplySpeed.py @@ -1,6 +1,7 @@ +from dataclasses import dataclass + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/Painting.py b/moviepy/video/fx/Painting.py index 3b35e4112..668016628 100644 --- a/moviepy/video/fx/Painting.py +++ b/moviepy/video/fx/Painting.py @@ -1,9 +1,10 @@ +from dataclasses import dataclass + import numpy as np from PIL import Image, ImageFilter from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/Resize.py b/moviepy/video/fx/Resize.py index b315e2a03..354f546da 100644 --- a/moviepy/video/fx/Resize.py +++ b/moviepy/video/fx/Resize.py @@ -1,10 +1,12 @@ import numbers -from PIL import Image -import numpy as np -from moviepy.Effect import Effect from dataclasses import dataclass from typing import Union +import numpy as np +from PIL import Image + +from moviepy.Effect import Effect + @dataclass class Resize(Effect): diff --git a/moviepy/video/fx/Rotate.py b/moviepy/video/fx/Rotate.py index 1e5d70d1e..fc3b42ef0 100644 --- a/moviepy/video/fx/Rotate.py +++ b/moviepy/video/fx/Rotate.py @@ -1,11 +1,12 @@ import math import warnings +from dataclasses import dataclass import numpy as np from PIL import Image + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/SlideIn.py b/moviepy/video/fx/SlideIn.py index 14ba62049..0462c70a4 100644 --- a/moviepy/video/fx/SlideIn.py +++ b/moviepy/video/fx/SlideIn.py @@ -1,6 +1,7 @@ +from dataclasses import dataclass + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/SlideOut.py b/moviepy/video/fx/SlideOut.py index cb2425b98..d0030879e 100644 --- a/moviepy/video/fx/SlideOut.py +++ b/moviepy/video/fx/SlideOut.py @@ -1,6 +1,7 @@ +from dataclasses import dataclass + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/SuperSample.py b/moviepy/video/fx/SuperSample.py index 9ffa0b724..f3b642136 100644 --- a/moviepy/video/fx/SuperSample.py +++ b/moviepy/video/fx/SuperSample.py @@ -1,8 +1,9 @@ +from dataclasses import dataclass + import numpy as np from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/TimeMirror.py b/moviepy/video/fx/TimeMirror.py index b3260fd45..6ea277857 100644 --- a/moviepy/video/fx/TimeMirror.py +++ b/moviepy/video/fx/TimeMirror.py @@ -1,6 +1,7 @@ +from dataclasses import dataclass + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/TimeSymmetrize.py b/moviepy/video/fx/TimeSymmetrize.py index ed3bc1225..adf9be9de 100644 --- a/moviepy/video/fx/TimeSymmetrize.py +++ b/moviepy/video/fx/TimeSymmetrize.py @@ -1,6 +1,7 @@ +from dataclasses import dataclass + from moviepy.Clip import Clip from moviepy.Effect import Effect -from dataclasses import dataclass @dataclass diff --git a/moviepy/video/fx/__init__.py b/moviepy/video/fx/__init__.py index 4f5d20f47..8e79ad220 100644 --- a/moviepy/video/fx/__init__.py +++ b/moviepy/video/fx/__init__.py @@ -20,8 +20,8 @@ from moviepy.video.fx.LumContrast import LumContrast from moviepy.video.fx.MakeLoopable import MakeLoopable from moviepy.video.fx.Margin import Margin -from moviepy.video.fx.MasksAnd import MasksAnd from moviepy.video.fx.MaskColor import MaskColor +from moviepy.video.fx.MasksAnd import MasksAnd from moviepy.video.fx.MasksOr import MasksOr from moviepy.video.fx.MirrorX import MirrorX from moviepy.video.fx.MirrorY import MirrorY diff --git a/moviepy/video/io/gif_writers.py b/moviepy/video/io/gif_writers.py index 0a66b1ee8..57a69a33e 100644 --- a/moviepy/video/io/gif_writers.py +++ b/moviepy/video/io/gif_writers.py @@ -1,8 +1,9 @@ """MoviePy video GIFs writing.""" +import imageio.v3 as iio import proglog + from moviepy.decorators import requires_duration, use_clip_fps_by_default -import imageio.v3 as iio @requires_duration diff --git a/setup.py b/setup.py index 68f613b98..2e53f011a 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,10 @@ #!/usr/bin/env python """MoviePy setup script.""" +import runpy import sys from pathlib import Path -import runpy + try: from setuptools import find_packages, setup diff --git a/tests/conftest.py b/tests/conftest.py index 1b6a86af5..b6ef40e34 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,6 +7,7 @@ import importlib import inspect import io +import pathlib import pkgutil import socketserver import sys @@ -16,7 +17,6 @@ import numpy as np import pytest -import pathlib from moviepy.video.io.VideoFileClip import VideoFileClip diff --git a/tests/test_compositing.py b/tests/test_compositing.py index b94aecb30..7835e2f43 100644 --- a/tests/test_compositing.py +++ b/tests/test_compositing.py @@ -1,8 +1,11 @@ """Compositing tests for use with pytest.""" import os + import numpy as np + import pytest + from moviepy import * diff --git a/tests/test_doc_examples.py b/tests/test_doc_examples.py index 35019be9d..294dba062 100644 --- a/tests/test_doc_examples.py +++ b/tests/test_doc_examples.py @@ -1,13 +1,12 @@ """Try to run all the documentation examples with runpy and check they dont raise exception""" import os -import pytest -import shutil -import runpy import pathlib - +import runpy +import shutil from contextlib import contextmanager -import os + +import pytest from moviepy.tools import no_display_available diff --git a/tests/test_tools.py b/tests/test_tools.py index 07aaad287..7d8d04456 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -10,8 +10,8 @@ import pytest -from moviepy import * import moviepy.tools as tools +from moviepy import * @pytest.mark.parametrize( diff --git a/tests/test_videotools.py b/tests/test_videotools.py index f6515eff5..28837916d 100644 --- a/tests/test_videotools.py +++ b/tests/test_videotools.py @@ -11,7 +11,6 @@ import pytest from moviepy import * - from moviepy.audio.tools.cuts import find_audio_period from moviepy.video.tools.credits import CreditsClip from moviepy.video.tools.cuts import ( @@ -23,6 +22,7 @@ from moviepy.video.tools.drawing import circle, color_gradient, color_split from moviepy.video.tools.interpolators import Interpolator, Trajectory + try: importlib.import_module("ipython.display") except ImportError: