diff options
author | Arun Isaac | 2023-01-24 13:02:01 +0000 |
---|---|---|
committer | Arun Isaac | 2023-01-24 13:22:20 +0000 |
commit | 99c0139cd37f72d73196eb97c7a56ee143a70600 (patch) | |
tree | 4af513dfc123fd6b3bb3fc388115013c5b065e0d | |
parent | 0d79d0d2e1af066b49420ad3ea026ccada604f6f (diff) | |
download | genenetwork3-99c0139cd37f72d73196eb97c7a56ee143a70600.tar.gz |
search: Use comprehension when splitting location.
* gn3/api/search.py (parse_location_field): Use comprehension.
-rw-r--r-- | gn3/api/search.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gn3/api/search.py b/gn3/api/search.py index 0e832da..8ce51e3 100644 --- a/gn3/api/search.py +++ b/gn3/api/search.py @@ -173,9 +173,8 @@ def parse_location_field(species_query: xapian.Query, raise ValueError location: tuple[Maybe[int], Maybe[int]] if ".." in location_str: - the_range = parse_range(location_str) - location = (the_range[0].map(apply_si_suffix), # type: ignore - the_range[1].map(apply_si_suffix)) # type: ignore + location = tuple(limit.map(apply_si_suffix) # type: ignore + for limit in parse_range(location_str)) # If point location, assume +/- 50 kbases on either side. else: width = 50*10**3 |