Skip to content

Commit 2ccd4f3

Browse files
MNT: fix ruff issue E712
E712 Comparison to `False` should be `cond is False` E712 Comparison to `True` should be `cond is True`
1 parent 257aa8b commit 2ccd4f3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bids/layout/layout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ def to_df(self, metadata=False, **filters):
567567
query = self.session.query(Tag).filter(Tag.file_path.in_(file_paths))
568568

569569
if not metadata:
570-
query = query.join(Entity).filter(Tag.is_metadata == False)
570+
query = query.join(Entity).filter(Tag.is_metadata == False) # noqa: E712
571571

572572
tags = query.all()
573573

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

951951
if not include_entities:
952-
query = query.join(Entity).filter(Tag.is_metadata == True)
952+
query = query.join(Entity).filter(Tag.is_metadata == True) # noqa: E712
953953

954954
results = query.all()
955955
if results:

bids/layout/tests/test_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_layoutinfo_init():
4848
assert str(exc.value).startswith("Missing mandatory")
4949
args['config'] = ['bids', 'derivatives']
5050
info = LayoutInfo(**args)
51-
assert info.derivatives == True
51+
assert info.derivatives is True
5252
assert info._derivatives == 'true'
5353

5454

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

7171

0 commit comments

Comments
 (0)