-
Notifications
You must be signed in to change notification settings - Fork 24
Draft #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
do we want to move those keys or add a new key |
Good question, I think the latter. Since data:
sample:
"1":
in: Hello
ans: World!
yaml:
args: -n 42 # This makes no sense in the Hello World example, I just wanted to spam all the keys 😛
input_validator_args: case_insensitive
output_validator_args: case_insensitive
full_feedback: True
hint: Greet the world!
description: A test case in which the world is greeted. |
1c63698
to
4ea74f5
Compare
b8bad97
to
46533d9
Compare
2216d59
to
a560f79
Compare
6c1d18c
to
8e64e58
Compare
* implemented constants * expose constants in more latex files * rewrote zip export * small changes * remove print * fix typos * substitute in testdata.yaml * add test problem * add test * fix submission dir * update tests * add tests * fix? * fix * allow substitution in generator commands * update file name regex * fix * restric problem name * mock constants * small changes * fix --------- Co-authored-by: Maarten Sijm <[email protected]>
* add bt upgrade * implemented todos * introduce SPEC constant * remove legacy parsing * fix * fix * simplify code * upgrade test files * remove empty keys * updated test yamls * fix * fix name * use newer version of bt upgrade * improve bt upgrade * add missing dir * [upgrade] Remove comments from limits if both limits are the new default * [upgrade] Ad-hoc import for CommentedMap and CommentedSeq * try to insert testdata before data * try to preserve the right comments * try to preserve the right comments * [upgrade] Improve preserving of comments when removing keys * [upgrade] Improve replacing of keys at their original position * fix errors * rerun upgrade * readd output validator dir * [upgrade] Only write generators.yaml when it changed --------- Co-authored-by: Maarten Sijm <[email protected]>
…oblem_slide/` (#434) * use new paths * update latex template files * update skel * ran bt upgrade * remove stem call * implemented suggestions * export more stuff * Rewrite problem_statement to statement/solution/problem_slide in documentation * [export] Move files in solution/ or problem_slide/ to problem_statement/, not statement/ * use pdfType everywhere * dont create empty keys * return empty list on error * update glob patterns --------- Co-authored-by: Maarten Sijm <[email protected]>
* use output_validator * upgraded tests * updated skel * fix symlink * create output_validators dir * changed class constants * fix source_dir(s) * copy symlinks * export legacy * [export] Fix typo in comment --------- Co-authored-by: Maarten Sijm <[email protected]>
…age-format#372 (#437) * [problem] Update parsing of problem.yaml based on Kattis/problem-package-format#372 Changes: - **C1**: Keywords are now a list of strings (we used to still parse them as a single string, woops) - **C2**: No change needed, this was just a "bug" in the human-readable text of the specification - **C3**: Add constraints to float/int types in `limits` and warnings when any of the values are out of range - **C5**: Do not allow lists to be empty (if a list-field is optional, it should be either `None` or a non-empty list) The discussion for **C4** was moved to Kattis/problem-package-format#378 and is pending consensus, and the proposals for **C6**, **Q1**, and **Q2** were dropped. * [problem] Fix parsing of ProblemSource, thanks to Thore's extra tests * [test] Add some more tests for license/rights_owner Note that I haven't thoroughly tested the combination of `license` and `rights_owner`. Similar to embargo_until, BAPCtools doesn't really do much with this information anyway, so the parser there is currently quite lenient, and as such I'll consider it out-of-scope for this PR. If others feel like improving and adding tests for this, feel free to do so 🙂
* partially implement draft for samples * only set out path if necessary * fix missing key * only check necessary .out files * use outpath if possible * some types * use string type name... * fix union type? * fix typing * drop .out support * dont warn here * add .out support * fix tests * made ans=out assumption optional * fix code * allow ans validators for interactive and multipass problems * add missing validator * properly handle samples in export * properly handle samples in export * properly handle samples in export * allow more answer validators * properly find testcases * [doc] Improve grammar in documentation * [validate] Replace import of Union with string type hint * hide A stat for interactive problems * dont always create empty ans files * add comment * rename * fix samples * only drop known suffixes * simplify code * add more tests * allow standalone in.statement * removed outdated assert * removed outdated if * undo namechange * update files * remove wip file * [export] bt samplezip: check for duplicate files from attachments/ * [validate] Skip sanity checks for empty .ans files for interactive problems * [test] samplezip/zip: assert that the correct samples are in the zip files * [test] Add samples for constants problem * [export] build_problem_zip: Make sure that .*.download files also end up in the zip * improve warning * [problem] Problem._samples: split warning message for has_raw over multiple lines * [export] Simplify getting of all samples: .interaction is included in KNOWN_DATA_EXTENSIONS * [generate] For interactive and/or multi-pass samples, allow .in.download and .interaction when both .in and .in.statement are missing Also generate empty .ans.statement or .ans.download files if they don't exist yet. * simplify code * i hate python tuples * [generate] generate_empty_interactive_sample_ans: stop when .ans file exists * [generate] Move generate_empty_interactive_sample_ans to later step * generators.cue: Add '{in,ans}.{statement,download}' to #testcase * [test] Fix test_schemata.sh: run from correct directory, replace {%placeholders%} * [test] test_schemata.sh: Skip empty snippets for now * [generate] Allow writing empty hardcoded files Kinda ugly, but should be caught by validators and sanity checks anyway, so having the check here should™ be redundant. This does allow writing empty .{in,ans}.{statement,download} files, which are _not_ sanity-checked. --------- Co-authored-by: Maarten Sijm <[email protected]>
* remove format_validators * rename folders * [problem] Problem._validators: remove `assert cls.source_dir` because all {Input,Answer,Output}Validator classes now only have source_dir, instead of source_dirs. --------- Co-authored-by: Maarten Sijm <[email protected]>
* make legacy export an explicit command * [export] Add all the directories! * [export] Legacy: remove solution/ and problem_slide/ from export dir * [export] Make answer_validators/ not required Apparently, `bt validate` also doesn't require them? * prepend problem name * fix test * handle languages * use ngerman * add german to wsl * keep languages in sync * keep languages in sync * [export] Add comment explaining why name in problems.yaml can also be str * [doc] Improve singular/plural in explanation of `--languages` * [export][latex] Rename --languages flag to --lang * [test][export] Add assertions for which PDFs should be in the ZIPs * [test] TestContest.test_zip: also remove constituent zip files after test completes --------- Co-authored-by: Maarten Sijm <[email protected]>
* use source_dir at all places * use source_dir even more * fix bits/stdc++ check
* drop bad support * fix * Fix log messages when renaming data/bad/* * [stats] Rename "bad" to "inv" and "good" to "v_o" to stay closer to their actual names --------- Co-authored-by: Maarten Sijm <[email protected]>
* new signal handling * add variation of old handler * less restrictice * move asserts outside of actual preexec function * move asserts outside of actual preexec function * move asserts outside of actual preexec function * directly reference the python executeable * clean up ans generation/validation * use proper max_len * lock output
See Kattis/problem-package-format#415 I'm not a big fan of the partially-copied parse_optional_list_persons, but I fought the type checker for long enough to say this is better than some unreadable abstraction 😛
…guration (#456) * Rename testdata.yaml to test_group.yaml Also took the time to replace some occurrences of test{case,group,node} with test{ ,_}{case,group,node}. Verified by grepping `(?<![Cc]heck)testdata` that the phrase "testdata" no longer occurs, except in upgrade.py. * [schemas] Update schemas for test_group.yaml * Introduce Test Case Configuration .yaml file, move .hint and .desc to there * Do not allow an unnumbered test case to be named 'test_group' This is also mentioned in https://icpc.io/problem-package-format/spec/2023-07-draft.html#test-data * [schemas] Move `test_group.yaml` from `data` to top-level
bt upgrade
port old problems to new spec #295)problem_statement/
intostatement/
,solution/
, andproblem_slide/
#434)problem.yaml
, small changes suggested Kattis/problem-package-format#372 ([problem] Update parsing of problem.yaml based on Kattis/problem-package-format#372 #437)data/bad/
(Drop support fordata/bad
#445)credits
to a map of strings: Allow person (in credits) to be specified as a map Kattis/problem-package-format#415 (fixed in abb49f8)testdata.yaml
totest_group.yaml
and split off<testcase>.yaml
from it (Rename testdata.yaml to test_group.yaml and implement Test Case Configuration #456)args
andfull_feedback
are accepted when parsing, but we don't need to implement them per se (we should warn if we indeed don't)*.hint
and*.desc
to<testcase>.yaml
keyshint:
anddescription:
(Rename testdata.yaml to test_group.yaml and implement Test Case Configuration #456)license
andrights_owner
(see Clarify rights owner Kattis/problem-package-format#391 and [problem] Update parsing of problem.yaml based on Kattis/problem-package-format#372 #437 (comment))Not part of the spec, but now that we're changing things anyway:
testsession
incontest.yaml
totest_session
(fixed in c5adbcf)New features to BAPCtools that can also be added separately from upgrading the current implementation from
legacy
to2023-07-draft
: