Skip to content

New config system #294

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0e9b9af
start work on new config system
square-cylinder Mar 11, 2025
62df7fa
begin documenting parser
square-cylinder Mar 13, 2025
613437e
Planning about config verification system
square-cylinder Mar 21, 2025
6cc3131
Work on defining "alternatives" property better and allowing it for i…
square-cylinder Mar 22, 2025
71cd0eb
Make code to match alternatives
square-cylinder Mar 22, 2025
3fa220a
Start working on parsing rules
square-cylinder Mar 22, 2025
1d6144e
Work on implementing config loading and parsing
square-cylinder Mar 23, 2025
0cb4831
Update spec.md
Zazmuz Mar 23, 2025
0e2223c
Begin implementing copy-from dependencies
square-cylinder Mar 23, 2025
78c9d36
Implement system for loading config
square-cylinder Mar 23, 2025
f9eaa78
Make tests and fix bugs
square-cylinder Mar 23, 2025
2123163
Split config parsing into multiple files
square-cylinder Mar 23, 2025
c67a96f
Make config_path more robust, split some things
square-cylinder Mar 23, 2025
5a4bd24
More parsing rules, more tests
square-cylinder Mar 24, 2025
cbc6d33
Small fixes
square-cylinder Mar 24, 2025
0b82957
Tests for matching and bug fixes
square-cylinder Mar 24, 2025
7f47cb9
Add .vscode/ to gitignore
square-cylinder Mar 24, 2025
8e58c63
Implement alternative-checks
square-cylinder Mar 24, 2025
93906c1
Implement match_properties among some other things
square-cylinder Mar 24, 2025
6874f13
Make parsers for new format
square-cylinder Mar 25, 2025
bd00cb7
Load a minimal config of the new type in a test
square-cylinder Mar 25, 2025
02e766c
Start implementing new config system in verifyproblem
square-cylinder Mar 25, 2025
4f628b2
Can now verify (basic) legacy problem again, yippie!
square-cylinder Mar 25, 2025
314a814
Bug fixes
square-cylinder Mar 25, 2025
1a710a0
Some additional changes
square-cylinder Mar 25, 2025
a76595e
Fix bugs
square-cylinder Mar 25, 2025
b22b5a9
Make ints be interpreted as floats
square-cylinder Mar 25, 2025
57b9dc5
Clarify new feature in spec.md
square-cylinder Mar 25, 2025
ae185ec
Add new problem config to new format version
square-cylinder Mar 25, 2025
481133c
small fix to hopefully pass CI tests
square-cylinder Mar 25, 2025
5555449
Fixed mypy static typing errors for CI tests
Zazmuz Mar 25, 2025
ff1003b
Made invert_graph more robust
Zazmuz Mar 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/support/default_validator/default_validator
/support/interactive/interactive
build/
.vscode/
1 change: 1 addition & 0 deletions problemtools/ProblemPlasTeX/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def render(self, document):
if templatepath == None:
raise Exception('Could not find templates needed for conversion to HTML')

assert templatepath is not None
# Ugly but unfortunately PlasTeX is quite inflexible when it comes to
# configuring where to search for template files
os.environ['ProblemRendererTEMPLATES'] = templatepath
Expand Down
213 changes: 213 additions & 0 deletions problemtools/config/2023-07_config_specification.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
type: object
required: [problem_format_version,name,uuid]
properties:
problem_format_version:
type: string
default: "2023-07"
alternatives:
"2023-07": {}
type:
type: object
parsing: type-2023-07
properties:
pass-fail:
type: bool
default: True
alternatives:
True:
require:
type/scoring: False
False: {}
scoring:
type: bool
multi-pass:
type: bool
interactive:
type: bool
submit-answer:
type: bool
alternatives:
True:
require:
type/interactive: False
type/multi-pass: False
False: {}
content:
type: string
alternatives:
pass-fail: {}
scoring: {}
multi-pass: {}
interactive: {}
submit-answer: {}
name:
type: object
parsing: name-2023-07
properties:
en: # en will always exist, if english really doesn't exist, it will be an empty string
type: string
match_properties:
"[a-z]{2,3}|[a-z]{2}-[A-Z]{2}":
type: string
uuid:
type: string
version:
type: string
credits:
type: object
parsing: credits-2023-07
properties:
authors:
type: list
parsing: string-to-list
content:
type: string
contributors:
type: list
parsing: string-to-list
content:
type: string
testers:
type: list
parsing: string-to-list
content:
type: string
translators:
type: object
properties: {}
match_properties:
"[a-z]{2,3}|[a-z]{2}-[A-Z]{2}":
type: list
parsing: string-to-list
content:
type: string
packagers:
type: list
parsing: string-to-list
content:
type: string
acknowledgements:
type: list
content:
type: string
source:
type: list
parsing: source-2023-07
content:
type: object
parsing: source-item-2023-07
properties:
name:
type: string
url:
type: string
license:
type: string
default: unknown
alternatives:
unknown:
warn: License is unknown
require:
rights_owner: ".+"
cc0|cc by|cc by-sa|educational|permission:
require:
rights_owner: ".+"
public domain:
forbid:
rights_owner: ".+"
rights_owner:
type: string
parsing: rights-owner-2023-07
embargo_until:
type: string
alternatives:
"": {}
"\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}Z)?": {}
limits:
type: object
properties:
time_multipliers:
type: object
properties:
ac_to_time_limit:
type: float
default: 2.0
alternatives:
"1.0:": {}
time_limit_to_tle:
type: float
default: 1.5
alternatives:
"1.0:": {}
time_limit:
type: float
default: 0.0 # Hmm, time limit needs to be calculated by default
alternatives:
"0.0:": {}
time_resolution:
type: float
default: 1.0
alternatives:
"0.0:": {}
memory:
type: int
default: copy-from:system_default/memory
alternatives:
"1:": {}
output:
type: int
default: copy-from:system_default/output
alternatives:
"1:": {}
code:
type: int
default: copy-from:system_default/code
alternatives:
"1:": {}
compilation_time:
type: int
default: copy-from:system_default/compilation_time
alternatives:
"1:": {}
compilation_memory:
type: int
default: copy-from:system_default/compilation_memory
alternatives:
"1:": {}
validation_time:
type: int
default: copy-from:system_default/validation_time
alternatives:
"1:": {}
validation_memory:
type: int
default: copy-from:system_default/validation_memory
alternatives:
"1:": {}
validation_output:
type: int
default: copy-from:system_default/validation_output
alternatives:
"1:": {}
validation_passes:
type: int
default: 2
alternatives:
"2:": {}
keywords:
type: list
content:
type: string
languages:
type: list
parsing: languages-parsing
content:
type: string
allow_file_writing:
type: bool
constants:
type: object
properties: {}
match_properties:
"[a-zA-Z_][a-zA-Z0-9_]*":
type: string # In spec, this should be allowed to be int or float as well... This is not supported for this system
Loading