Skip to content

Commit

Permalink
format(black): formatted files to latest version (Zulko#1735)
Browse files Browse the repository at this point in the history
  • Loading branch information
tharun634 authored Mar 13, 2022
1 parent 8eaf3f0 commit 0b63f47
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/moving_letters.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


def vortex(screenpos, i, nletters): # noqa D103
d = lambda t: 1.0 / (0.3 + t ** 8) # damping
d = lambda t: 1.0 / (0.3 + t**8) # damping
a = i * np.pi / nletters # angle of the movement
v = rotMatrix(a).dot([-1, 0])
if i % 2:
Expand All @@ -30,7 +30,7 @@ def vortex(screenpos, i, nletters): # noqa D103

def cascade(screenpos, i, nletters): # noqa D103
v = np.array([0, -1])
d = lambda t: 1 if t < 0 else abs(np.sinc(t) / (1 + t ** 4))
d = lambda t: 1 if t < 0 else abs(np.sinc(t) / (1 + t**4))
return lambda t: screenpos + v * 400 * d(t - 0.15 * i)


Expand Down
2 changes: 1 addition & 1 deletion moviepy/audio/tools/cuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def find_audio_period(clip, min_time=0.1, max_time=2, time_resolution=0.01):
chunksize = int(time_resolution * clip.fps)
chunk_duration = 1.0 * chunksize / clip.fps
# v denotes the list of volumes
v = np.array([(chunk ** 2).sum() for chunk in clip.iter_chunks(chunksize)])
v = np.array([(chunk**2).sum() for chunk in clip.iter_chunks(chunksize)])
v = v - v.mean()
corrs = np.correlate(v, v, mode="full")[-len(v) :]
corrs[: int(min_time / chunk_duration)] = 0
Expand Down
2 changes: 1 addition & 1 deletion moviepy/video/fx/accel_decel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def _f_accel_decel(t, old_duration, new_duration, abruptness=1.0, soonness=1.0):

def _f(t):
def f1(t):
return (0.5) ** (1 - a) * (t ** a)
return (0.5) ** (1 - a) * (t**a)

def f2(t):
return 1 - f1(1 - t)
Expand Down
2 changes: 1 addition & 1 deletion moviepy/video/fx/mask_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def mask_color(clip, color=None, threshold=0, stiffness=1):

def hill(x):
if threshold:
return x ** stiffness / (threshold ** stiffness + x ** stiffness)
return x**stiffness / (threshold**stiffness + x**stiffness)
else:
return 1.0 * (x != 0)

Expand Down
2 changes: 1 addition & 1 deletion moviepy/video/io/ffmpeg_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ def ffmpeg_parse_infos(

popen_params = cross_platform_popen_params(
{
"bufsize": 10 ** 5,
"bufsize": 10**5,
"stdout": sp.PIPE,
"stderr": sp.PIPE,
"stdin": sp.DEVNULL,
Expand Down
1 change: 0 additions & 1 deletion moviepy/video/io/html_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class HTML2(HTML): # noqa D101
def __add__(self, other):
return HTML2(self.data + other.data)


except ImportError:

def HTML2(content): # noqa D103
Expand Down
2 changes: 1 addition & 1 deletion moviepy/video/tools/drawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def color_gradient(
vector = np.array(vector[::-1])

norm = np.linalg.norm(vector)
n_vec = vector / norm ** 2 # norm 1/norm(vector)
n_vec = vector / norm**2 # norm 1/norm(vector)

p1 = p1 + offset * vector
arr = (M - p1).dot(n_vec) / (1 - offset)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_matplotlib_simple_example(util):

def make_frame(t):
ax.clear()
ax.plot(x, np.sinc(x ** 2) + np.sin(x + 2 * np.pi / duration * t), lw=3)
ax.plot(x, np.sinc(x**2) + np.sin(x + 2 * np.pi / duration * t), lw=3)
ax.set_ylim(-1.5, 2.5)
return mplfig_to_npimage(fig)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def make_frame(t):

classifier = svm.SVC(gamma=2, C=1)
# the varying weights make the points appear one after the other
weights = np.minimum(1, np.maximum(0, t ** 2 + 10 - np.arange(50)))
weights = np.minimum(1, np.maximum(0, t**2 + 10 - np.arange(50)))
classifier.fit(X, Y, sample_weight=weights)
Z = classifier.decision_function(np.c_[xx.ravel(), yy.ravel()])
Z = Z.reshape(xx.shape)
Expand Down

0 comments on commit 0b63f47

Please sign in to comment.