Kattis / problemtools

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

input_validator_flags unexpected behaviour with test data groups #208

Open bandgeekdante opened 2 years ago

bandgeekdante commented 2 years ago

According to https://www.kattis.com/problem-package-format/spec/problem_package_format, the input_validator_flags key in testdata.yaml should interpret a filename string as "the name of the input validator that will be used for this test data group". However, when I set the flag with a custom validator for each group (each .ctd files), the validators try to validate themselves (i.e. they take as input the validator file, as opposed to the input file). This doesn't match my interpretation of the documentation, but maybe I'm interpreting it wrong. How should I correctly have a separate validator for each test group?

bandgeekdante commented 2 years ago

If instead I try to use input_validator_flags as a map, I get the following error:

Traceback (most recent call last):
  File "/usr/local/bin/verifyproblem", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/problemtools/verifyproblem.py", line 1540, in main
    [errors, warnings] = prob.check(args)
  File "/usr/local/lib/python3.8/dist-packages/problemtools/verifyproblem.py", line 1471, in check
    item.check(args)                                                                                                                                                                                                                           
  File "/usr/local/lib/python3.8/dist-packages/problemtools/verifyproblem.py", line 913, in check
    collect_flags(self._problem.testdata, all_flags)
  File "/usr/local/lib/python3.8/dist-packages/problemtools/verifyproblem.py", line 912, in collect_flags
    collect_flags(subgroup, flags)
  File "/usr/local/lib/python3.8/dist-packages/problemtools/verifyproblem.py", line 912, in collect_flags
    collect_flags(subgroup, flags)
  File "/usr/local/lib/python3.8/dist-packages/problemtools/verifyproblem.py", line 910, in collect_flags
    flags.add(group.config['input_validator_flags'])
TypeError: unhashable type: 'dict'