Skip to content

Commit

Permalink
Sort task file entities for executive summary.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Sep 19, 2023
1 parent 787d257 commit 06ececc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion xcp_d/interfaces/execsummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import re
from pathlib import Path

import numpy as np
import pandas as pd
from bids.layout import BIDSLayout, Query
from bs4 import BeautifulSoup
from jinja2 import Environment, FileSystemLoader, Markup
Expand Down Expand Up @@ -166,10 +168,17 @@ def collect_inputs(self):
task_entity_sets = []
for entity_set in unique_entity_sets:
for entity in ORDERING:
entity_set[entity] = entity_set.get(entity, Query.NONE)
entity_set[entity] = entity_set.get(entity, np.nan)

task_entity_sets.append(entity_set)

# Now sort the entity sets by each entity
task_entity_sets = pd.DataFrame(task_entity_sets)
task_entity_sets = task_entity_sets.sort_values(by=task_entity_sets.columns.tolist())
task_entity_sets = task_entity_sets.fillna(Query.NONE)
task_entity_sets = task_entity_sets.to_dict(orient="records")

# Collect figures for concatenated resting-state data (if any)
concatenated_rest_files = {}

query = {
Expand Down

0 comments on commit 06ececc

Please sign in to comment.