Skip to content
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

New cases file format #38

Open
iceboy233 opened this issue May 19, 2017 · 5 comments
Open

New cases file format #38

iceboy233 opened this issue May 19, 2017 · 5 comments
Assignees

Comments

@iceboy233
Copy link
Member

iceboy233 commented May 19, 2017

  • Use yaml as config
  • Case insensitive
  • Recursive
  • Cover all existing use cases
  • Automatically convertible from "legacy case"
  • Support special judge

Initial thinking:

time: 1s
memory: 16m
score: 10
children:
- input: input/input0.txt
  output: output/output0.txt
- input: input/input1.txt
  output: output/output1.txt
- judge:
    file: judge.cc
    lang: cc
    time: 5s
    memory: 64m
    data: ['data/state', 'data/transition']
  score: 30
  children:
  - input: input/input2.txt
    data: data/state
    memory: 32m
  - input: input/input3.txt
    data: data/state
    score: 50
    memory: 2048m

This is an extreme case. Normal config should be much simpler.

@q234rty
Copy link

q234rty commented Jul 4, 2017

YAML is quite unfriendly to beginners.

@twd2
Copy link
Member

twd2 commented Aug 26, 2017

Could you please explain in more details? @iceb0y

@q234rty
Copy link

q234rty commented Oct 29, 2017

TOML seems simpler and maybe better for this purpose.

@iceboy233
Copy link
Member Author

Looks like yaml supports inheritance by itself.

The proposed config can be rewritten as:

default: &default
  time: 1s
  memory: 16m
  score: 10
default2: &default2
  <<: *default
  judge:
    file: judge.cc
    lang: cc
    time: 5s
    memory: 64m
    data: ['data/state', 'data/transition']
  score: 30
cases:
- <<: *default
  input: input/input0.txt
  output: output/output0.txt
- <<: *default
  input: input/input1.txt
  output: output/output1.txt
- <<: *default2
  input: input/input2.txt
  data: data/state
  memory: 32m
- <<: *default2
  input: input/input3.txt
  data: data/state
  score: 50
  memory: 2048m

Parse result:

[{'input': 'input/input0.txt',
  'memory': '16m',
  'output': 'output/output0.txt',
  'score': 10,
  'time': '1s'},
 {'input': 'input/input1.txt',
  'memory': '16m',
  'output': 'output/output1.txt',
  'score': 10,
  'time': '1s'},
 {'data': 'data/state',
  'input': 'input/input2.txt',
  'judge': {'data': ['data/state', 'data/transition'],
            'file': 'judge.cc',
            'lang': 'cc',
            'memory': '64m',
            'time': '5s'},
  'memory': '32m',
  'score': 30,
  'time': '1s'},
 {'data': 'data/state',
  'input': 'input/input3.txt',
  'judge': {'data': ['data/state', 'data/transition'],
            'file': 'judge.cc',
            'lang': 'cc',
            'memory': '64m',
            'time': '5s'},
  'memory': '2048m',
  'score': 50,
  'time': '1s'}]

iceboy233 added a commit that referenced this issue Nov 19, 2017
iceboy233 added a commit that referenced this issue Nov 23, 2017
implement yaml-based format (#38)
@iceboy233
Copy link
Member Author

https://github.com/vstakhov/libucl is another option

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

No branches or pull requests

3 participants