Skip to content

Commit

Permalink
MNT: fix ruff issue E712
Browse files Browse the repository at this point in the history
	E712 Comparison to `False` should be `cond is False`
	E712 Comparison to `True` should be `cond is True`
  • Loading branch information
DimitriPapadopoulos committed Apr 21, 2023
1 parent 257aa8b commit 2ccd4f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bids/layout/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ def to_df(self, metadata=False, **filters):
query = self.session.query(Tag).filter(Tag.file_path.in_(file_paths))

if not metadata:
query = query.join(Entity).filter(Tag.is_metadata == False)
query = query.join(Entity).filter(Tag.is_metadata == False) # noqa: E712

tags = query.all()

Expand Down Expand Up @@ -949,7 +949,7 @@ def get_metadata(self, path, include_entities=False, scope='all'):
.filter(BIDSFile.path == str(path)))

if not include_entities:
query = query.join(Entity).filter(Tag.is_metadata == True)
query = query.join(Entity).filter(Tag.is_metadata == True) # noqa: E712

results = query.all()
if results:
Expand Down
4 changes: 2 additions & 2 deletions bids/layout/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_layoutinfo_init():
assert str(exc.value).startswith("Missing mandatory")
args['config'] = ['bids', 'derivatives']
info = LayoutInfo(**args)
assert info.derivatives == True
assert info.derivatives is True
assert info._derivatives == 'true'


Expand All @@ -65,7 +65,7 @@ def test_entity_init_all_args(subject_entity):
ent = subject_entity
assert ent.name == 'subject'
assert ent.pattern == r"[/\\\\]sub-([a-zA-Z0-9]+)"
assert ent.mandatory == False
assert ent.mandatory is False
assert ent.directory == "{subject}"


Expand Down

0 comments on commit 2ccd4f3

Please sign in to comment.