Skip to content

Commit

Permalink
Small fix to date filter for ambiguous dates
Browse files Browse the repository at this point in the history
Cherry picked from @rneher's commit 2d68b83
  • Loading branch information
trvrb committed Aug 5, 2018
1 parent 5cf3fca commit 8f42074
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions augur/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])<args.max_date]
seq_keep = [s for s in seq_keep if (np.isscalar(dates[s]) or all(dates[s])) and np.min(dates[s])<args.max_date]

# subsampling. This will sort sequences into groups by meta data fields
# specified in --group-by and then take at most --sequences-per-group
Expand Down

0 comments on commit 8f42074

Please sign in to comment.