Skip to content

Commit 70b99c4

Browse files
committed
Fix issue when floating point numbers are present in batch
1 parent c977d06 commit 70b99c4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/pyard-reduce-csv

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,15 @@ def redux(allele, locus, column_name):
121121
if ":" in allele:
122122
locus_allele = f"{locus}*{allele}"
123123
else:
124-
locus_allele = f"{locus}{allele}" # serology
124+
if allele.isnumeric():
125+
# Serology alleles are all numeric
126+
locus_allele = f"{locus}{allele}" # serology
127+
else:
128+
# Watch out, we may get floats when exported from Excel.
129+
message = f"Failed reducing '{allele}' in column {column_name}"
130+
print(message)
131+
failed_to_reduce_alleles.append((column_name, allele))
132+
return allele
125133

126134
# Check the config if this allele should be reduced
127135
if should_be_reduced(allele, locus_allele):

0 commit comments

Comments
 (0)