Skip to content

Commit

Permalink
Show pending projects in the report
Browse files Browse the repository at this point in the history
  • Loading branch information
aanil committed May 30, 2024
1 parent 61f9b7a commit 90cc0c7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion daily_read/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, env_file_path):
self.FETCH_FROM_SNPSEQ = os.getenv("DAILY_READ_FETCH_FROM_SNPSEQ")
self.FETCH_FROM_UGC = os.getenv("DAILY_READ_FETCH_FROM_UGC")
self.STATUS_PRIORITY = {
0: "None",
0: "Pending",
1: "Samples Received",
2: "Reception Control finished",
3: "Library QC finished",
Expand Down
7 changes: 4 additions & 3 deletions daily_read/daily_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
}

STATUS_DESCRIPTIONS = {
"All Raw data Delivered": "The data has been made available through NGIs delivery system",
"All Samples Sequenced": "Sequencing (including potential resequencing) of all samples has been finished",
"All Raw data Delivered": "The data has been made available through NGIs delivery system.",
"All Samples Sequenced": "Sequencing (including potential resequencing) of all samples has been finished.",
"Library QC finished": "Library QC is a quality control of the sequencing library produced either by NGI or supplied by you, depending on the type of project.",
"Reception Control finished": "Reception Control consists of NGI staff measuring e.g. concentration and volume for the samples received.",
"Samples Received": "The samples have been received and registered at NGI",
"Samples Received": "The samples have been received and registered at NGI.",
"Pending": "The order has been set up but the samples have not yet been received by NGI.",
}

PORTAL_URL = "https://ngisweden.scilifelab.se/orders"
Expand Down
3 changes: 2 additions & 1 deletion daily_read/ngi_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ def __init__(
else:
self.status = latest_statuses[0]
else:
log.info(f"No project dates found for {project_id}")
log.info(f"No project dates found for {project_id}, so setting its status to Pending")
self.status = "Pending"

@property
def internal_id_or_portal_id(self):
Expand Down
2 changes: 1 addition & 1 deletion daily_read/templates/daily_report.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
</div>
</div>
</div>
{% if data["projects"]|length == 1 and None in data["projects"] %}
{% if data["projects"]|length == 0 %}
<div class="row justify-content-center p-5 m-3">
<div class="col-auto">No recorded activity at the time of report generation!</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion tests/test_ngi_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ def test_get_data_with_no_project_dates(data_repo_full, mocked_statusdb_conn_row
data_master.get_data("NGI123459")
assert len(data_master.data.keys()) == 1
assert "NGI123459" in data_master.data
assert "No project dates found for NGI123459" in caplog.text
assert "No project dates found for NGI123459, so setting its status to Pending" in caplog.text
assert data_master.data["NGI123459"].status == "Pending"


def test_skip_order_with_no_year(data_repo_full, mocked_statusdb_conn_rows, caplog, get_env_file_path):
Expand Down

0 comments on commit 90cc0c7

Please sign in to comment.