|
1 | | -from functools import partial, wraps, lru_cache |
| 1 | +from functools import lru_cache, partial, wraps |
2 | 2 | from inspect import signature |
3 | 3 | from itertools import combinations |
4 | 4 |
|
5 | 5 | import numpy as np |
| 6 | +from scipy.fftpack import ifft |
6 | 7 | from scipy.ndimage import label |
7 | 8 | from scipy.stats.mstats import linregress |
8 | | -from scipy.fftpack import ifft |
9 | 9 |
|
10 | 10 | from .minimum_phase_decomposition import minimum_phase_decomposition |
11 | | -from .statistics import (adjust_for_multiple_comparisons, |
12 | | - fisher_z_transform, |
13 | | - get_normal_distribution_p_values, coherence_bias) |
| 11 | +from .statistics import (adjust_for_multiple_comparisons, coherence_bias, |
| 12 | + fisher_z_transform, get_normal_distribution_p_values) |
14 | 13 |
|
15 | 14 | EXPECTATION = { |
16 | 15 | 'trials': partial(np.mean, axis=1), |
@@ -625,7 +624,7 @@ def generalized_partial_directed_coherence(self): |
625 | 624 | return _squared_magnitude( |
626 | 625 | self._MVAR_Fourier_coefficients / |
627 | 626 | np.sqrt(noise_variance) / _total_outflow( |
628 | | - self._MVAR_Fourier_coefficients, noise_variance)) |
| 627 | + self._MVAR_Fourier_coefficients, noise_variance)) |
629 | 628 |
|
630 | 629 | def direct_directed_transfer_function(self): |
631 | 630 | '''A combination of the directed transfer function estimate of |
@@ -710,20 +709,20 @@ def _linear_regression(response): |
710 | 709 | slope = np.full(new_shape, np.nan) |
711 | 710 | slope[..., signal_combination_ind[:, 0], |
712 | 711 | signal_combination_ind[:, 1]] = np.array( |
713 | | - regression_results[..., 0, :], dtype=np.float) |
| 712 | + regression_results[..., 0, :], dtype=np.float) |
714 | 713 | slope[..., signal_combination_ind[:, 1], |
715 | 714 | signal_combination_ind[:, 0]] = -1 * np.array( |
716 | | - regression_results[..., 0, :], dtype=np.float) |
| 715 | + regression_results[..., 0, :], dtype=np.float) |
717 | 716 |
|
718 | 717 | delay = slope / (2 * np.pi) |
719 | 718 |
|
720 | 719 | r_value = np.ones(new_shape) |
721 | 720 | r_value[..., signal_combination_ind[:, 0], |
722 | 721 | signal_combination_ind[:, 1]] = np.array( |
723 | | - regression_results[..., 2, :], dtype=np.float) |
| 722 | + regression_results[..., 2, :], dtype=np.float) |
724 | 723 | r_value[..., signal_combination_ind[:, 1], |
725 | 724 | signal_combination_ind[:, 0]] = np.array( |
726 | | - regression_results[..., 2, :], dtype=np.float) |
| 725 | + regression_results[..., 2, :], dtype=np.float) |
727 | 726 | return delay, slope, r_value |
728 | 727 |
|
729 | 728 | def delay(self, frequencies_of_interest=None, |
|
0 commit comments