Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show pending projects in the report #42

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.",
aanil marked this conversation as resolved.
Show resolved Hide resolved
}

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
Loading