Skip to content
Permalink
Browse files

Merge pull request #96 from nextstrain/date-interval-select

Move date selection function
  • Loading branch information...
barneypotter24 committed Jul 30, 2019
2 parents 7e7479d + 7861a3b commit 5de14b4b13f1cc5c5d6de829524f792c92a7d253
Showing with 16 additions and 17 deletions.
  1. +16 −17 vdb/download.py
@@ -7,6 +7,22 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from base.rethink_io import rethink_io

def rethinkdb_date_greater(greater_date, comparison_date, relaxed_interval):
return r.branch(r.lt(greater_date[0], comparison_date[0]),
False,
r.eq(greater_date[0], comparison_date[0]),
r.branch(r.eq(greater_date[1], 'XX').or_(r.eq(comparison_date[1],'XX')),
relaxed_interval,
r.lt(greater_date[1], comparison_date[1]),
False,
r.eq(greater_date[1], comparison_date[1]),
r.branch(r.eq(greater_date[2], 'XX').or_(r.eq(comparison_date[2],'XX')),
relaxed_interval,
r.lt(greater_date[2], comparison_date[2]),
False,
True),
True),
True)

def get_parser():
import argparse
@@ -319,20 +335,3 @@ def output(self, documents, path, fstem, ftype, **kwargs):
os.makedirs(args.path)
connVDB = download(**args.__dict__)
connVDB.download(**args.__dict__)

def rethinkdb_date_greater(greater_date, comparison_date, relaxed_interval):
return r.branch(r.lt(greater_date[0], comparison_date[0]),
False,
r.eq(greater_date[0], comparison_date[0]),
r.branch(r.eq(greater_date[1], 'XX').or_(r.eq(comparison_date[1],'XX')),
relaxed_interval,
r.lt(greater_date[1], comparison_date[1]),
False,
r.eq(greater_date[1], comparison_date[1]),
r.branch(r.eq(greater_date[2], 'XX').or_(r.eq(comparison_date[2],'XX')),
relaxed_interval,
r.lt(greater_date[2], comparison_date[2]),
False,
True),
True),
True)

0 comments on commit 5de14b4

Please sign in to comment.
You can’t perform that action at this time.