OpenBench
OpenBench copied to clipboard
Produce clearer error messages for malformed SPSA input
I have found that usually when I make a mistake with the SPSA input, OpenBench simply says Malformed SPSA Input
, with no reference to where, why, or how the input is malformed.
This PR detects and produces errors for the two most common (only?) causes of this message:
- When a line does not have the appropriate number of fields, the error
Parameters must have 7 fields, for <param name>
is produced. When the line is blank, the line number is shown. - When any of the five numeric fields is not a float, the error
<field name> must be numeric, for <param name>
is produced.
Example input:
param, float, 1-, 5, 2, 0.5, 0.002
Produces these errors:
Value must be numeric, for param
Max does not exceed Min, for param
Parameters must have 7 fields, for line 2