From 28e7648abaea2177ec1911114381dda8a76b1d9c Mon Sep 17 00:00:00 2001 From: Tatiana Gurbich Date: Tue, 23 Jul 2024 16:33:12 +0100 Subject: [PATCH] Changed lat/lon handling --- genomeuploader/genome_upload.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/genomeuploader/genome_upload.py b/genomeuploader/genome_upload.py index a19590c..2416c53 100755 --- a/genomeuploader/genome_upload.py +++ b/genomeuploader/genome_upload.py @@ -494,12 +494,18 @@ def combine_ENA_info(genomeInfo, ENADict): latitude = latitList[0] if multipleElementSet(latitList): latitude = "not provided" - genomeInfo[g]["latitude"] = str(round(float(latitude), GEOGRAPHY_DIGIT_COORDS)) + try: + genomeInfo[g]["latitude"] = str(round(float(latitude), GEOGRAPHY_DIGIT_COORDS)) + except ValueError: + genomeInfo[g]["latitude"] = "not provided" longitude = longList[0] if multipleElementSet(longList): longitude = "not provided" - genomeInfo[g]["longitude"] = str(round(float(longitude), GEOGRAPHY_DIGIT_COORDS)) + try: + genomeInfo[g]["longitude"] = str(round(float(longitude), GEOGRAPHY_DIGIT_COORDS)) + except ValueError: + genomeInfo[g]["longitude"] = "not provided" samples = samplesList[0] if multipleElementSet(samplesList):