Skip to content

Commit

Permalink
[forest-fixes] adds commit hash to forest task view.
Browse files Browse the repository at this point in the history
  • Loading branch information
biblicabeebli committed Dec 12, 2023
1 parent 5a3d9dc commit a2229b6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
33 changes: 21 additions & 12 deletions frontend/templates/forest/task_log.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,28 @@ <h4 class="modal-title">Forest Task Details</h4>
<div class="panel panel-default">
<div class="panel-heading">Task Metadata</div>
<div class="panel-body">

<dl style="margin-bottom: 0;">
<dt>Patient ID</dt>
<dd>{% raw %}{{ modalLog.patient_id }}{% endraw %}</dd>
<dt>Tree</dt>
<dd>{% raw %}{{ modalLog.forest_tree_display }}{% endraw %}</dd>
<dt>Data Date Start</dt>
<dd>{% raw %}{{ modalLog.data_date_start }}{% endraw %}</dd>
<dt>Data Date End</dt>
<dd>{% raw %}{{ modalLog.data_date_end }}{% endraw %}</dd>
<dt>Status</dt>
<dd>{% raw %}{{ modalLog.status }}{% endraw %}</dd>
<dt>Created On</dt>
<dd>{% raw %}{{ modalLog.created_on_display }}{% endraw %}</dd>
<div class="col-xs-6">
<dt>Patient ID</dt>
<dd>{% raw %}{{ modalLog.patient_id }}{% endraw %}</dd>
<dt>Tree</dt>
<dd>{% raw %}{{ modalLog.forest_tree_display }}{% endraw %}</dd>
<dt>Task ID</dt>
<dd>{% raw %}{{ modalLog.external_id }}{% endraw %}</dd>
<dt>Forest Commit</dt>
<dd>{% raw %}{{ modalLog.forest_commit }}{% endraw %}</dd>
</div>
<div class="col-xs-6"></div>
<dt>Data Date Start</dt>
<dd>{% raw %}{{ modalLog.data_date_start }}{% endraw %}</dd>
<dt>Data Date End</dt>
<dd>{% raw %}{{ modalLog.data_date_end }}{% endraw %}</dd>
<dt>Status</dt>
<dd>{% raw %}{{ modalLog.status }}{% endraw %}</dd>
<dt>Created On</dt>
<dd>{% raw %}{{ modalLog.created_on_display }}{% endraw %}</dd>
</div>
</dl>
</div>
</div>
Expand Down
12 changes: 9 additions & 3 deletions pages/forest_pages.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import csv
import pickle
from collections import defaultdict
from datetime import date, datetime, timedelta
from datetime import date, datetime

import orjson
from django.contrib import messages
Expand Down Expand Up @@ -45,7 +45,8 @@
"participant__patient_id", # -> patient_id
"pickled_parameters",
"forest_tree", # -> forest_tree_display as .title()
"output_zip_s3_path", # need to identify that it is present at all
"forest_commit",
"output_zip_s3_path", # need to identify that it is present at all
# datetimes
"process_end_time", # -> dev time format
"process_start_time", # -> dev time format
Expand Down Expand Up @@ -169,7 +170,12 @@ def task_log(request: ResearcherRequest, study_id=None):
tasks = []

for task_dict in query:
extern_id = task_dict.pop("external_id")
extern_id = task_dict["external_id"]

# the commit is populated when the task runs, not when it is queued.
task_dict["forest_commit"] = task_dict["forest_commit"] if task_dict["forest_commit"] else \
"(exact commit missing)"

# renames (could be optimized in the query, but speedup is negligible)
task_dict["patient_id"] = task_dict.pop("participant__patient_id")

Expand Down

0 comments on commit a2229b6

Please sign in to comment.