diff --git a/README.md b/README.md index aa489fc..117b6a2 100644 --- a/README.md +++ b/README.md @@ -101,19 +101,18 @@ Run funnel binary from terminal. Output `errors.csv`, `lowerBound.csv`, `upperBound.csv`, `reference.csv`, `test.csv` into the output directory (`./results` by default). optional arguments: - -h, --help show this help message and exit - --output OUTPUT Path of directory to store output data - --atolx ATOLX Absolute tolerance along x axis - --atoly ATOLY Absolute tolerance along y axis - --ltolx LTOLX Relative tolerance along x axis (relatively to the local value) - --ltoly LTOLY Relative tolerance along y axis (relatively to the local value) - --rtolx RTOLX Relative tolerance along x axis (relatively to the range) - --rtoly RTOLY Relative tolerance along y axis (relatively to the range) + -h, --help show this help message and exit + --output OUTPUT Path of directory to store output data + --atolx ATOLX Absolute tolerance along x axis + --atoly ATOLY Absolute tolerance along y axis + --ltolx LTOLX Relative tolerance along x axis (relatively to the local value) + --ltoly LTOLY Relative tolerance along y axis (relatively to the local value) + --rtolx RTOLX Relative tolerance along x axis (relatively to the range) + --rtoly RTOLY Relative tolerance along y axis (relatively to the range) required named arguments: - --reference REFERENCE - Path of CSV file with reference data - --test TEST Path of CSV file with test data + --reference REFERENCE Path of two-column CSV file with reference data + --test TEST Path of two-column CSV file with test data Full documentation at https://github.com/lbl-srg/funnel ``` diff --git a/pyfunnel/pyfunnel.py b/pyfunnel/pyfunnel.py index 057bb3d..4747726 100755 --- a/pyfunnel/pyfunnel.py +++ b/pyfunnel/pyfunnel.py @@ -31,12 +31,12 @@ required_named.add_argument( "--reference", - help="Path of CSV file with reference data", + help="Path of two-column CSV file with reference data", required=True ) required_named.add_argument( "--test", - help="Path of CSV file with test data", + help="Path of two-column CSV file with test data", required=True ) parser.add_argument( @@ -89,6 +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)) for row in spamreader: try: data[s]['x'].append(float(row[0]))