Skip to content

Commit bd0d585

Browse files
committed
STY: black [ignore-rev]
1 parent b330385 commit bd0d585

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

nipype/utils/filemanip.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -934,24 +934,32 @@ def indirectory(path):
934934
finally:
935935
os.chdir(cwd)
936936

937+
937938
def load_spm_mat(spm_mat_file, **kwargs):
938939
try:
939940
mat = sio.loadmat(spm_mat_file, **kwargs)
940941
except NotImplementedError:
941942
import h5py
942943
import numpy as np
944+
943945
mat = dict(SPM=np.array([[sio.matlab.mat_struct()]]))
944946

945947
# Get Vbeta, Vcon, and Vspm file names
946948
with h5py.File(spm_mat_file, "r") as h5file:
947949
fnames = dict()
948950
try:
949-
fnames["Vbeta"] = [u"".join(chr(c[0]) for c in h5file[obj_ref[0]]) for obj_ref in h5file["SPM"]["Vbeta"]["fname"]]
951+
fnames["Vbeta"] = [
952+
u"".join(chr(c[0]) for c in h5file[obj_ref[0]])
953+
for obj_ref in h5file["SPM"]["Vbeta"]["fname"]
954+
]
950955
except Exception:
951956
fnames["Vbeta"] = []
952957
for contr_type in ["Vcon", "Vspm"]:
953958
try:
954-
fnames[contr_type] = [u"".join(chr(c[0]) for c in h5file[obj_ref[0]]["fname"]) for obj_ref in h5file["SPM"]["xCon"][contr_type]]
959+
fnames[contr_type] = [
960+
u"".join(chr(c[0]) for c in h5file[obj_ref[0]]["fname"])
961+
for obj_ref in h5file["SPM"]["xCon"][contr_type]
962+
]
955963
except Exception:
956964
fnames[contr_type] = []
957965

@@ -980,4 +988,4 @@ def load_spm_mat(spm_mat_file, **kwargs):
980988
else:
981989
setattr(mat["SPM"][0, 0], "xCon", np.empty((0, 0), dtype=object))
982990

983-
return mat
991+
return mat

0 commit comments

Comments
 (0)