Skip to content

Commit

Permalink
Added .txt support
Browse files Browse the repository at this point in the history
  • Loading branch information
llegregam committed May 17, 2022
1 parent 9235bec commit d4f48d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions physiofit/base/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ def _read_data(path_to_data: str) -> DataFrame:

data_path = Path(path_to_data).resolve()

if data_path.suffix == ".tsv":
if data_path.suffix in [".txt", ".tsv"]:
data = read_csv(str(data_path), sep="\t")
elif data_path.suffix == ".csv":
data = read_csv(str(data_path), sep=";")
else:
if not data_path.exists():
raise ValueError(f"{data_path} is not a valid file")
else:
raise TypeError(f"{data_path} is not a valid format. Accepted formats are .csv or .tsv")
raise TypeError(f"{data_path} is not a valid format. Accepted formats are .csv, .txt or .tsv")

IoHandler._verify_data(data)
return data
Expand Down
2 changes: 1 addition & 1 deletion physiofit/ui/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def parse_args():
parser = argparse.ArgumentParser("Physiofit: Extracellular flux estimation software")

# Parse data arguments (tsv + json)
parser.add_argument("-t", "--data", type=str, help="Path to data file in tsv format")
parser.add_argument("-t", "--data", type=str, help="Path to data file in tabulated format (txt or tsv)")
parser.add_argument("-c", "--config", type=str, help="Path to config file in json format")

# Parse basic parameters
Expand Down

0 comments on commit d4f48d3

Please sign in to comment.