From 14aed51e4aab04c1c53549ee9f1ce5fc20d6b11e Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 14 Apr 2025 16:10:49 -0500 Subject: Convert values to float where present. --- scripts/phenotypes_bulk_edit.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/phenotypes_bulk_edit.py') diff --git a/scripts/phenotypes_bulk_edit.py b/scripts/phenotypes_bulk_edit.py index bbce60d..0b4fec5 100644 --- a/scripts/phenotypes_bulk_edit.py +++ b/scripts/phenotypes_bulk_edit.py @@ -148,6 +148,12 @@ def read_file(filepath: Path) -> Iterator[str]: ((None if item.strip() == "" else item.strip()) for item in fields))) _pheno, _xref = _dict.pop("UniqueIdentifier").split("::") + _dict = { + key: ((float(val) if bool(val) else val) + if key not in BULK_EDIT_COMMON_FIELDNAMES + else val) + for key, val in _dict.items() + } _dict["phenotype_id"] = int(_pheno.split(":")[1]) _dict["xref_id"] = int(_xref.split(":")[1]) if _dict["PubMed_ID"] is not None: -- cgit v1.2.3