diff options
author | zsloan | 2022-02-01 20:06:57 +0000 |
---|---|---|
committer | BonfaceKilz | 2022-02-02 11:04:40 +0300 |
commit | eede05baf5e7573a7d29398a517e10b6c441145a (patch) | |
tree | bb8ceff2b30924e240c0ae86420a9030f8d53684 /gn3/db/traits.py | |
parent | 679c9733cc71f88c14eb79d4b2fa8ed2bdd23b13 (diff) | |
download | genenetwork3-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
Diffstat (limited to 'gn3/db/traits.py')
-rw-r--r-- | gn3/db/traits.py | 2 |
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 |