Skip to content

Commit

Permalink
fix flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Aug 30, 2023
1 parent 0d7d595 commit b0ee188
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions atlasreader/atlasreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def read_atlas_peak(atlastype, coordinate, prob_thresh=5):

# get atlas data
checked_atlastype = check_atlases(atlastype)
if type(checked_atlastype) == list:
if isinstance(checked_atlastype, list):
if not len(checked_atlastype) == 1:
raise ValueError(
'\'{}\' is not a string or a single atlas. \'all\' '
Expand Down Expand Up @@ -407,7 +407,7 @@ def read_atlas_cluster(atlastype, cluster, affine, prob_thresh=5):

# get atlas data
checked_atlastype = check_atlases(atlastype)
if type(checked_atlastype) == list:
if isinstance(checked_atlastype, list):
if not len(checked_atlastype) == 1:
raise ValueError(
'\'{}\' is not a string or a single atlas. \'all\' '
Expand Down Expand Up @@ -572,8 +572,9 @@ def get_peak_data(clust_img, atlas='default', prob_thresh=5,
segment = read_atlas_peak(atype, coord, prob_thresh)
coord_info.append([atype.atlas, segment])

peak_info += [[peak if type(peak) != list else
'; '.join(['{}% {}'.format(*e) for e in peak])
peak_info += [['; '.join(['{}% {}'.format(*e) for e in peak])
if isinstance(peak, list)
else peak
for (_, peak) in coord_info]]

return np.column_stack([coords, peak_values, cluster_volume, peak_info])
Expand Down

0 comments on commit b0ee188

Please sign in to comment.