Restore most of the old API offered by problemtools.verifyproblem.Problem#320
Merged
gkreitz merged 5 commits intoKattis:developfrom May 22, 2025
Merged
Conversation
We don't really offer a stable API, but this restores most of the old API used to access aspects of a problem (config remaining a large, breaking change). The rework and API changes that had been done early in the process of supporting 2023-07-draft do not seem to be needed, so this PR reverts much of it to simplify verifyproblem and ease porting API users (mostly Kattis) to the new version by keeping the number of breaking changes down.
pehrsoderman
approved these changes
May 22, 2025
| def __init__(self, problem: Problem, aspect_name: str, base: str, testcasegroup: TestCaseGroup) -> None: | ||
| super().__init__(f'{problem.shortname}.{aspect_name}.{testcasegroup.name}.{os.path.basename(base)}', problem) | ||
| def __init__(self, problem: Problem, base: str, testcasegroup: TestCaseGroup) -> None: | ||
| super().__init__(f'{problem.shortname}.test.{testcasegroup.name}.{os.path.basename(base)}', problem) |
Contributor
There was a problem hiding this comment.
Why is test needed here?
Contributor
Author
There was a problem hiding this comment.
It's not needed, it's just the old string that was there earlier. These strings are passed to logging to fetch the logger, so we want a hierarchy, so we want * something* in between shortname and testcasegroup.name to denote the test cases. There are tools which apparently parse verifyproblem output https://github.com/Kodsport/testdata_tools/blob/master/analyzetestgroups.py (yikes!), so I figured just sticking the string as it was in the earlier release made the most sense.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We don't really offer a stable API, but this restores most of the old API used to access aspects of a problem (config remaining a large, breaking change).
The rework and API changes that had been done early in the process of supporting 2023-07-draft do not seem to be needed, so this PR reverts much of it to simplify
verifyproblemand ease porting API users (mostly Kattis, I assume) to the new version by keeping the number of breaking changes down.Adds two minor changes to the API (and keeps the large change that metadata is now accessed via
problem.metadatainstead ofproblem.config):problems.attachments.attachmentschanged fromlist[str]tolist[Path]problem.timelim(previously, it was put intoconfig)