Skip to content

Commit

Permalink
small fixes to date filter when using with ambiguous dates
Browse files Browse the repository at this point in the history
  • Loading branch information
rneher committed Aug 5, 2018
1 parent b6d63cf commit 2d68b83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions augur/data/lat_longs.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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

2 comments on commit 2d68b83

@trvrb
Copy link
Member

@trvrb trvrb commented on 2d68b83 Aug 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rneher: Should this be in drm? Seems like it should be in master.

@rneher
Copy link
Member Author

@rneher rneher commented on 2d68b83 Aug 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we fix the remaining issues in drm tomorrow and merge it...

Please sign in to comment.