Skip to content

Commit

Permalink
utils: parse metadata as strings to avoid mis-interpretation of numer…
Browse files Browse the repository at this point in the history
…ical taxon names
  • Loading branch information
rneher committed Jan 14, 2020
1 parent e5c35f5 commit 8fe857c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions treetime/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def parse_dates(date_file, name_col=None, date_col=None):

try:
# read the metadata file into pandas dataframe.
df = pd.read_csv(date_file, sep=full_sep, engine='python')
df = pd.read_csv(date_file, sep=full_sep, engine='python', dtype='str')
# check the metadata has strain names in the first column
# look for the column containing sampling dates
# We assume that the dates might be given either in human-readable format
Expand Down Expand Up @@ -318,7 +318,7 @@ def parse_dates(date_file, name_col=None, date_col=None):

if all(v is None for v in dates.values()):
raise TreeTimeError("ERROR: Cannot parse dates correctly! Check date format.")

print(dates)
return dates
except TreeTimeError as err:
raise err
Expand Down

0 comments on commit 8fe857c

Please sign in to comment.