[style] fixed style issues in new calc rdm movie function
@@ -9,7 +9,7 @@ from collections.abc import Iterable
import numpy as np
from pyrsa.rdm.rdms import RDMs
from pyrsa.rdm.rdms import concat
-from pyrsa.data import average_dataset_by, Dataset
+from pyrsa.data import average_dataset_by
from pyrsa.util.matrix import pairwise_contrast_sparse
@@ -99,12 +99,11 @@ def calc_rdm_movie(dataset, method='euclidean', descriptor=None, noise=None,
Returns:
pyrsa.rdm.rdms.RDMs: RDMs object with RDM movie
-
"""
if isinstance(dataset, Iterable):
rdms = []
- for i_dat in range(len(dataset)):
+ for i_dat, _ in enumerate(dataset):
if noise is None:
rdms.append(calc_rdm_movie(dataset[i_dat], method=method,
descriptor=descriptor))
@@ -118,7 +117,6 @@ def calc_rdm_movie(dataset, method='euclidean', descriptor=None, noise=None,
noise=noise[i_dat]))
rdm = concat(rdms)
else:
-
if bins is not None:
binned_data = dataset.bin_time(time_descriptor, bins)
splited_data = binned_data.split_time(time_descriptor)
@@ -137,9 +135,9 @@ def calc_rdm_movie(dataset, method='euclidean', descriptor=None, noise=None,
rdm = concat(rdms)
rdm.rdm_descriptors[time_descriptor] = time
-
return rdm
+
def calc_rdm_euclid(dataset, descriptor=None):
"""
calculates an RDM from an input dataset using euclidean distance
