aboutsummaryrefslogtreecommitdiff
path: root/gn3/api/search.py
diff options
context:
space:
mode:
authorArun Isaac2023-01-24 18:59:24 +0000
committerArun Isaac2023-01-24 19:03:19 +0000
commita9c011099b9e5fcf66dde8f4ceb87ac90838aa7b (patch)
tree7be733e4c7437c71d9c615c03d532d7840846138 /gn3/api/search.py
parentbf376b14593a29b48fd2558baff946d0495ae329 (diff)
downloadgenenetwork3-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.
Diffstat (limited to 'gn3/api/search.py')
-rw-r--r--gn3/api/search.py2
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),