diff options
author | Arun Isaac | 2023-01-24 18:59:24 +0000 |
---|---|---|
committer | Arun Isaac | 2023-01-24 19:03:19 +0000 |
commit | a9c011099b9e5fcf66dde8f4ceb87ac90838aa7b (patch) | |
tree | 7be733e4c7437c71d9c615c03d532d7840846138 | |
parent | bf376b14593a29b48fd2558baff946d0495ae329 (diff) | |
download | genenetwork3-a9c011099b9e5fcf66dde8f4ceb87ac90838aa7b.tar.gz |
search: Use decimals, not floats, when converting to megabases.
* gn3/api/search.py (parse_location_field): Use decimals, not floats, when
converting to megabases.
-rw-r--r-- | gn3/api/search.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gn3/api/search.py b/gn3/api/search.py index 328baf5..aa844ee 100644 --- a/gn3/api/search.py +++ b/gn3/api/search.py @@ -176,7 +176,7 @@ def parse_location_field(species_query: xapian.Query, def make_query(interval: ChromosomalInterval) -> xapian.Query: # TODO: Convert the xapian index to use bases instead of megabases. - to_megabases = lambda x: str(float(x)/1e6) + to_megabases = lambda x: str(Decimal(x)/10**6) return combine_queries(xapian.Query.OP_AND, species_query, xapian.Query(chromosome_prefix + interval.chromosome), |