Skip to content

Commit

Permalink
fix: improving operator functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
dbirman committed Dec 10, 2024
1 parent 40165c5 commit 64f7816
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/aind_qc_portal/projects/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, project_name: str):
self.project_name = project_name
self._df = None
self.exposed_columns = [
"subject_id", "Date", "name", "Operator", "S3 link", "Status", "Subject view", "QC view", "session_type", "raw"
"subject_id", "Date", "name", "Researcher", "S3 link", "Status", "Subject view", "QC view", "session_type", "raw"
]
self._get_assets()

Expand All @@ -37,6 +37,10 @@ def _get_assets(self):
else:
qc = None

operator_list = record.get('session', {}).get('experimenter_full_name')
if operator_list:
operator_list = list(operator_list)

record_data = {
'_id': record.get('_id'),
'raw': record.get('data_description', {}).get('data_level') == 'raw',
Expand All @@ -46,7 +50,7 @@ def _get_assets(self):
'session_start_time': record.get('session', {}).get('session_start_time'),
'session_type': record.get('session', {}).get('session_type'),
'subject_id': subject_id,
'operator': list(record.get('session', {}).get('experimenter_full_name')),
'operator': operator_list,
'Status': qc.status().value if qc else "No QC",
}
data.append(record_data)
Expand All @@ -62,7 +66,7 @@ def _get_assets(self):
self._df["Subject view"] = self._df["_id"].apply(lambda x: format_link(f"/qc_asset_app?id={x}"))
self._df["qc_link"] = self._df["_id"].apply(lambda x: f"/qc_app?id={x}")
self._df["QC view"] = self._df.apply(lambda row: format_link(row["qc_link"]), axis=1)
self._df["Operator"] = self._df["operator"].apply(lambda x: ", ".join(x))
self._df["Researcher"] = self._df["operator"].apply(lambda x: ", ".join(x) if x else None)
self._df.sort_values(by="timestamp", ascending=True, inplace=True)
self._df.sort_values(by="subject_id", ascending=False, inplace=True)

Expand Down

0 comments on commit 64f7816

Please sign in to comment.