FIX: Filtering in BIDSLayoutIndexer#1063
Conversation
Remove if clause on self.filters
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1063 +/- ##
==========================================
- Coverage 89.80% 89.74% -0.06%
==========================================
Files 63 63
Lines 7177 7179 +2
Branches 1374 1375 +1
==========================================
- Hits 6445 6443 -2
- Misses 532 535 +3
- Partials 200 201 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
effigies
left a comment
There was a problem hiding this comment.
I'm realizing that the **filters argument only says it applies to filtering files opened during get_metadata(). It was not intended to filter files.
That said, I can't think of a good reason to filter metadata but not files. @adelavega Do you remember the reasoning here?
| # Skip entities that don't match the filter | ||
| if self.filters and e.name and e.name in self.filters and m and m not in self.filters[e.name]: | ||
| continue | ||
| if m is not None: |
There was a problem hiding this comment.
This is the equivalent of
| # Skip entities that don't match the filter | |
| if self.filters and e.name and e.name in self.filters and m and m not in self.filters[e.name]: | |
| continue | |
| if m is not None: | |
| if m is not None and (e.name not in self.filters or m in listify(self.filters[e.name])): |
|
I'm not sure tbh. I traced this back to; #560 Then Yarkoni moved it around. Looks like we thought at the time that meta-data indexing was the most time consuming step, and implemented a way to skip meta-data indexing for a subset of files, rather then excluding them from being indexed altogether. |
Resolves (partially) #1062.