From 0988e1fb7c22e9e9c3cfe148f60863023228fb4b Mon Sep 17 00:00:00 2001 From: uditgulati Date: Mon, 10 May 2021 03:47:21 -0500 Subject: use f string in gsearch --- wqflask/wqflask/gsearch.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py index 4024fa7a..12cd2792 100644 --- a/wqflask/wqflask/gsearch.py +++ b/wqflask/wqflask/gsearch.py @@ -121,10 +121,8 @@ class GSearch: continue max_lrs_text = "N/A" - if this_trait['locus_chr'] != None and this_trait['locus_mb'] != None: - max_lrs_text = "Chr" + \ - str(this_trait['locus_chr']) + \ - ": " + str(this_trait['locus_mb']) + if this_trait['locus_chr'] and this_trait['locus_mb']: + max_lrs_text = f"Chr{str(this_trait['locus_chr']}): {str(this_trait['locus_mb'])}" this_trait['max_lrs_text'] = max_lrs_text trait_list.append(this_trait) @@ -271,8 +269,8 @@ class GSearch: this_trait['max_lrs_text'] = "N/A" if this_trait['dataset'] == this_trait['group'] + "Publish": try: - if this_trait['locus_chr'] != None and this_trait['locus_mb'] != None: - this_trait['max_lrs_text'] = "Chr" + str(this_trait['locus_chr']) + ": " + str(this_trait['locus_mb']) + if this_trait['locus_chr'] and this_trait['locus_mb']: + this_trait['max_lrs_text'] = f"Chr{str(this_trait['locus_chr']}): {str(this_trait['locus_mb'])}" except: this_trait['max_lrs_text'] = "N/A" -- cgit v1.2.3