From 2d68b83ef69d8a65ed3f7fbaa0437ffc358f8cd6 Mon Sep 17 00:00:00 2001 From: Richard Neher Date: Sun, 5 Aug 2018 20:41:57 +0200 Subject: [PATCH] small fixes to date filter when using with ambiguous dates --- augur/data/lat_longs.tsv | 1 + augur/filter.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/augur/data/lat_longs.tsv b/augur/data/lat_longs.tsv index 61997742e..b15b0e4db 100644 --- a/augur/data/lat_longs.tsv +++ b/augur/data/lat_longs.tsv @@ -82,6 +82,7 @@ country somalia 8.3676771 49.083416 country spain 40.0028028 -4.0031039 country suriname 4.1413025 -56.0771186 country sweden 59.6749712 14.5208584 +country taiwan 23.6978 120.9605 country thailand 14.8971921 100.83273 country tonga -19.9160818 -175.2026423 country turkey 39.0 35.0 diff --git a/augur/filter.py b/augur/filter.py index 85a99354e..9f669c426 100644 --- a/augur/filter.py +++ b/augur/filter.py @@ -123,9 +123,9 @@ def run(args): if (args.min_date or args.max_date) and 'date' in meta_columns: dates = get_numerical_dates(meta_dict, fmt="%Y-%m-%d") if args.min_date: - seq_keep = [s for s in seq_keep if dates[s] and np.max(dates[s])>args.min_date] + seq_keep = [s for s in seq_keep if (np.isscalar(dates[s]) or all(dates[s])) and np.max(dates[s])>args.min_date] if args.max_date: - seq_keep = [s for s in seq_keep if dates[s] and np.min(dates[s])