OpenBench icon indicating copy to clipboard operation
OpenBench copied to clipboard

Produce clearer error messages for malformed SPSA input

Open MinusKelvin opened this issue 4 months ago • 0 comments

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:

  1. 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.
  2. 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

MinusKelvin avatar Oct 07 '24 04:10 MinusKelvin