-
Notifications
You must be signed in to change notification settings - Fork 30
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
An easier way to configure test cases #71
Conversation
Why is this format necessary? Which OJ is currently using this format? |
Some users just want to add config files easily.
It allow users to config it easily.
|
A better way may be enhancing the existing yaml format. |
Got it. |
Write
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some necessary spaces.
And, please ensure your code can run before commit.
For example, i+'.in'
should be str(i) + '.in'
…dataset without config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These suggestions are about the code style, and, @iceb0y PTAL
BTW, we appreciated if you can give an example for each new format.
Please mark conversation resolved immediately after you made some changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contribution!
It seems that the problem is fixed now. |
@iceb0y PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @iceb0y review plz😭
@iceb0y 😢 are you there? |
PTAL @iceb0y , please |
Instead of doing this, can you create a SDK to generate config file? |
Creating an SDK to generate config files seems to be a new issue. |
I've written an SDK. |
Actually we have a luogu dev @moesoha here. What about create a common library for parsing and creating case packages? The library can be multi-language if needed. Note that we also had intention to move case storage to git repositories. If we wanted to merge this alone, we need to refine both logic and implementation (as discussed in vijos-dev privately). For logic, we need to make "config file missing" = "empty config" = "scanning files in zip". For implementation, we should use names from |
You mean create a new repo for parsing packages? |
Please refine both logic and implementation as @iceb0y said so that this PR can be merged. |
I don't understand what to do. |
def read_auto_cases(open, zip_file, time_limit='1s', memory_limit='128m', judge=''): | ||
prefix = '' | ||
cases = [] | ||
for filename in zip_file.namelist(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for filename in canonical_dict.keys():
Merge from vijos/vj4
Compare detail
cdef int b | ||
|
||
cdef int a, b | ||
cdef str cache_a = "", cache_b = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very slow. Consider using a expanding buffer (like c++'s std::vector
).
Also str
is unicode
in python 3, but the byte to char conversion is not needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a,b is a int, so convert is needed.
These changes are not going to be merged now.
It's only a self-test as we also need to modify vj4/handler/judge.py & vj4/ui/templates/record_detail.html .
config.json
like this:And your file should be like this: