Skip to content

Commit

Permalink
ruff fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Feb 20, 2024
1 parent 2cacc9e commit 81dcb0e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion nidmresults/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def load_contrasts(self, workaround=False):
pe_ids = pe_ids + (NIIRI.qname(str(args_pe["pe_id"])),)

mpe_id = NIIRI.qname(str(args["mpe_id"]))
if not (mpe_id, pe_ids) in contrasts:
if (mpe_id, pe_ids) not in contrasts:
contrasts[(mpe_id, pe_ids)] = [con]
else:
contrasts[(mpe_id, pe_ids)].append(con)
Expand Down
2 changes: 1 addition & 1 deletion nidmresults/objects/contrast.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(
):
super().__init__(oid=oid)
self.contrast_name = contrast_name
if not type(contrast_weights) is list:
if type(contrast_weights) is not list:
contrast_weights = json.loads(contrast_weights)
self.contrast_weights = contrast_weights
self.contrast_num = contrast_num
Expand Down
4 changes: 2 additions & 2 deletions nidmresults/objects/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, oid=None):
if oid is None:
self.id = NIIRI[str(uuid.uuid4())]
else:
if not type(oid) is QualifiedName:
if type(oid) is not QualifiedName:
oid = NIIRI.qname(Identifier(oid))
self.id = oid

Expand Down Expand Up @@ -187,7 +187,7 @@ def __init__(
units = ["mm", "mm", "mm"]

self.number_of_dimensions = numdim
if not type(vox_to_world) is np.ndarray:
if type(vox_to_world) is not np.ndarray:
# This is useful if info was read from a NIDM pack
vox_to_world = np.array(json.loads(vox_to_world))
dimensions = np.array(json.loads(dimensions))
Expand Down
4 changes: 2 additions & 2 deletions nidmresults/objects/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,13 +1232,13 @@ def __init__(
if x is not None and y is not None and z is not None:
self.coord_vector = [x, y, z]
else:
if coord_vector and not type(coord_vector) is list:
if coord_vector and type(coord_vector) is not list:
coord_vector = json.loads(coord_vector)
self.coord_vector = coord_vector
if x_std is not None and y_std is not None and z_std is not None:
self.coord_vector_std = [x_std, y_std, z_std]
else:
if coord_vector_std and not type(coord_vector_std) is list:
if coord_vector_std and type(coord_vector_std) is not list:
coord_vector_std = json.loads(coord_vector_std)
self.coord_vector_std = coord_vector_std

Expand Down
2 changes: 1 addition & 1 deletion nidmresults/objects/modelfitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def __init__(
self.image = image_file
else:
self.image = Image(image_file, img_filename)
if not type(regressors) is list:
if type(regressors) is not list:
regressors = json.loads(regressors)
self.regressors = regressors

Expand Down

0 comments on commit 81dcb0e

Please sign in to comment.