Skip to content
Snippets Groups Projects
Commit d951bc1d authored by Tobias Hangleiter's avatar Tobias Hangleiter
Browse files

Merge branch 'bugfixes' into 'master'

Bugfixes

See merge request !112
parents 557dc688 e3ab151e
Branches
No related tags found
1 merge request!112Bugfixes
......@@ -65,6 +65,7 @@ class FunctionChain:
Args:
*args: Positional arguments that get passed to each function besides the previous function's return value.
**kwargs: Keyword arguments that get passed to each function.
Returns:
......@@ -96,7 +97,16 @@ def chain(*functions: callable, n_args: int = 1, inspect_kwargs: bool = False) -
5
Args:
*functions: Functions to be chained.
*functions : callable
Functions to be chained.
n_args : int
Number of arguments accepted and returned by functions.
inspect_kwargs : bool
If true, only pass kwargs actually accepted by the functions.
Inspects the signature and therefore has some overhead.
Returns:
Callable object that chains arguments.
"""
......
......@@ -66,5 +66,5 @@ def convert_tiff(file: _pathT, fps: float, format: str = '.mp4', threads: Option
data = np.broadcast_to(data, data.shape[:3] + (3,))
clip = ImageSequenceClip(list(data), fps=fps)
clip.write_videofile(out_name, fps, audio=False, threads=threads,
clip.write_videofile(str(out_name), fps, audio=False, threads=threads,
logger=logger)
......@@ -441,8 +441,8 @@ def _fft_helper(x, win, detrend_func, normalize_func, nperseg, noverlap, nfft, s
# Detrend and normalize each data segment individually
result = normalize_func(detrend_func(result))
# Apply window by multiplication
result *= win
# Apply window by multiplication. No inplace op here since result might have uncastable type
result = win*result
# Perform the fft. Acts on last axis by default. Zero-pads automatically
if sides == 'twosided':
......@@ -451,4 +451,5 @@ def _fft_helper(x, win, detrend_func, normalize_func, nperseg, noverlap, nfft, s
result = result.real
func = fft.rfft
return func(result, n=nfft, workers=workers)
# Can overwrite because a new array is created above
return func(result, n=nfft, workers=workers, overwrite_x=True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment