aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2022-02-01 20:06:57 +0000
committerBonfaceKilz2022-02-02 11:04:40 +0300
commiteede05baf5e7573a7d29398a517e10b6c441145a (patch)
treebb8ceff2b30924e240c0ae86420a9030f8d53684
parent679c9733cc71f88c14eb79d4b2fa8ed2bdd23b13 (diff)
downloadgenenetwork3-eede05baf5e7573a7d29398a517e10b6c441145a.tar.gz
Fix bug where sample values of 0 were being treated as False
In line 91 of gn3/db/traits.py, there was an if statement "if record[key] else 'x'" that was treating values of 0 as False, so I changed it to explicitly check that values aren't None
-rw-r--r--gn3/db/traits.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gn3/db/traits.py b/gn3/db/traits.py
index cad53e7..fdbba21 100644
--- a/gn3/db/traits.py
+++ b/gn3/db/traits.py
@@ -88,7 +88,7 @@ def get_trait_csv_sample_data(conn: Any,
return str(num_str)
def __process_for_csv__(record):
return ",".join([
- __float_strip(record[key]) if record[key] else "x"
+ __float_strip(record[key]) if record[key] is not None else "x"
for key in ("sample_name", "value", "se_error", "nstrain")])
csv_data = ["Strain Name,Value,SE,Count"] + [
__process_for_csv__(record) for record in