Skip to content

Commit

Permalink
Update readme and help, check for exactly 2 columns
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineGautier committed Apr 3, 2024
1 parent 47ba43e commit 64cda69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The module `pyfunnel.py` can also be run with the following command line interfa
```
usage: pyfunnel.py [-h] --reference REFERENCE --test TEST [--output OUTPUT] [--atolx ATOLX] [--atoly ATOLY] [--ltolx LTOLX] [--ltoly LTOLY] [--rtolx RTOLX] [--rtoly RTOLY]
Run funnel binary from terminal.
Run funnel binary from terminal on two two-column CSV files.
Output `errors.csv`, `lowerBound.csv`, `upperBound.csv`, `reference.csv`, `test.csv` into the output directory (`./results` by default).
Expand Down
6 changes: 3 additions & 3 deletions pyfunnel/pyfunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description=(
'Run funnel binary from terminal.\n\n'
'Run funnel binary from terminal on two two-column CSV files.\n\n'
'Output `errors.csv`, `lowerBound.csv`, `upperBound.csv`, `reference.csv`, `test.csv` '
'into the output directory (`./results` by default).'),
epilog='Full documentation at https://github.com/lbl-srg/funnel'
Expand Down Expand Up @@ -89,8 +89,8 @@
data[s] = dict(x=[], y=[])
with open(vars(args)[s]) as csvfile:
spamreader = csv.reader(csvfile)
if (len(next(spamreader)) > 2):
raise RuntimeError("The {} CSV file cannot have more than two columns.".format(s))
if (len(next(spamreader)) != 2):
raise RuntimeError("The {} CSV file must have exactly two columns.".format(s))
for row in spamreader:
try:
data[s]['x'].append(float(row[0]))
Expand Down

0 comments on commit 64cda69

Please sign in to comment.