Skip to content

Commit 0db5fc4

Browse files
committed
ensure one file per reportlet
1 parent 3366a2a commit 0db5fc4

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

niworkflows/reports/core.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,17 +311,14 @@ def index(self, config):
311311
reportlets = []
312312
for c in list_combos:
313313
# do not display entities with the value None.
314-
c = list(filter(None, c))
315-
ent = list(compress(entities, c))
316-
missing_entities = list(set(entities) - set(ent))
314+
c_filt = list(filter(None, c))
315+
ent_filt = list(compress(entities, c_filt))
317316
# Set a common title for this particular combination c
318317
title = 'Reports for: %s.' % ', '.join(
319-
['%s <span class="bids-entity">%s</span>' % (ent[i], c[i])
320-
for i in range(len(c))])
318+
['%s <span class="bids-entity">%s</span>' % (ent_filt[i], c_filt[i])
319+
for i in range(len(c_filt))])
321320
for cfg in subrep_cfg['reportlets']:
322-
for m_e in missing_entities:
323-
cfg['bids'].pop(m_e, None)
324-
cfg['bids'].update({ent[i]: c[i] for i in range(len(c))})
321+
cfg['bids'].update({entities[i]: c[i] for i in range(len(c))})
325322
rlet = Reportlet(self.layout, self.out_dir, config=cfg)
326323
if not rlet.is_empty():
327324
rlet.title = title

0 commit comments

Comments
 (0)