Skip to content

Commit

Permalink
Update input_mod.py
Browse files Browse the repository at this point in the history
  • Loading branch information
theosanderson authored Jan 21, 2023
1 parent c0d2531 commit 0ce2a8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/chronumental/input_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def read_tabular_file(tabular_file_name, **kwargs):
stripped_name = tabular_file_name.replace(".gz", "").replace(
".bz2", "").replace(".xz", "").replace(".lzma", "")
if stripped_name.endswith(".csv"):
return pd.read_csv(tabular_file, **kwargs)
return pd.read_csv(tabular_file, dtype={"strain": str, "name": str, "taxon": str}, **kwargs)
if stripped_name.endswith(".tsv"):
return pd.read_csv(tabular_file, sep="\t", **kwargs)
return pd.read_csv(tabular_file, sep="\t", dtype={"strain": str, "name": str, "taxon": str},**kwargs)
raise Exception(
f"Tabular file {tabular_file_name} was expected to end in tsv or csv")

Expand Down

0 comments on commit 0ce2a8e

Please sign in to comment.