Skip to content

Commit

Permalink
Refactors based on comments from JoA and AA
Browse files Browse the repository at this point in the history
  • Loading branch information
chuan-wang committed Sep 27, 2024
1 parent d507588 commit e90db05
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions taca/analysis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,17 @@ def _upload_to_statusdb(run):
"Setup": {"Software": run.CONFIG.get("bcl2fastq", {})}
}
# Keep PDC archive date if there is one already
run_vals = run.split("_")
run_vals = parser.obj["name"].split("_")
if len(run_vals[0]) == 8:
run_date = run_vals[0][2:]

Check warning on line 161 in taca/analysis/analysis.py

View check run for this annotation

Codecov / codecov/patch

taca/analysis/analysis.py#L159-L161

Added lines #L159 - L161 were not covered by tests
else:
run_date = run_vals[0]
run_fc = f"{run_date}_{run_vals[-1]}"
try:
doc = db.view("names/name", reduce=False, include_docs=True)[run_fc].rows[0].doc
db_rows = db.view("names/name", reduce=False, include_docs=True)[run_fc].rows
if db_rows:
doc = db_rows[0].doc
if doc.get("pdc_archived") and not parser.obj.get("pdc_archived"):
parser.obj["pdc_archived"] = doc.get("pdc_archived")

Check warning on line 169 in taca/analysis/analysis.py

View check run for this annotation

Codecov / codecov/patch

taca/analysis/analysis.py#L163-L169

Added lines #L163 - L169 were not covered by tests
# New FC which does not exist
except IndexError:
pass

statusdb.update_doc(db, parser.obj, over_write_db_entry=True)

Expand Down

0 comments on commit e90db05

Please sign in to comment.