Skip to content

Conversation

@gkreitz
Copy link
Contributor

@gkreitz gkreitz commented May 22, 2025

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, 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.metadata instead of problem.config):

  • The type of problems.attachments.attachments changed from list[str] to list[Path]
  • To access the computed time limit, use problem.timelim (previously, it was put into config)

gkreitz added 5 commits May 21, 2025 17:05
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.
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is test needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@gkreitz gkreitz merged commit 36134ca into Kattis:develop May 22, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants