Kattis / problemtools

Tools to manage problem packages using the Kattis problem package format.
MIT License
101 stars 70 forks source link

accept_score expected to be number, not string #235

Open thorehusfeldt opened 10 months ago

thorehusfeldt commented 10 months ago

I may be wrong about this, but it looks as if verifyproblem expects the value of accept_score in testdata.yaml to be a number, not a string:

https://github.com/Kattis/problemtools/blob/307d417056e8dc8581db96572e945868e0559454/problemtools/verifyproblem.py#L289

The specification, however, has accept_score to be a string, see https://www.kattis.com/problem-package-format/spec/legacy.html#test-data-groups .

Most testdata.yaml files encountered in the wild look like this:

accept_score: 10
range: 0 10

but this actually violates the specification and should be

accept_score: "10"
range: 0 10

which proper, schema-aware editing tool would actually flag (mine does). Note that 0 10 is correctly turned into a string, but 10 looks like a number to YAML so it remains a number.

This may only be a temporary problem and not worth fixing; the proper type for accept_score should be numerical anyway and the proplem package format is moving in that direction.

austrin commented 8 months ago

I'm inclined to agree that this is a wontfix due to problemtools just being ahead of the times - accept_score should clearly be a numerical field, right?