feat: add default score for diff
All checks were successful
build / build (push) Successful in 1m54s
All checks were successful
build / build (push) Successful in 1m54s
This commit is contained in:
parent
5acb2ca201
commit
ca63a94238
|
@ -5,7 +5,6 @@ from joj3_config_generator.models.common import Memory, Time
|
||||||
DEFAULT_CPU_LIMIT = Time("1s")
|
DEFAULT_CPU_LIMIT = Time("1s")
|
||||||
DEFAULT_MEMORY_LIMIT = Memory("256m")
|
DEFAULT_MEMORY_LIMIT = Memory("256m")
|
||||||
DEFAULT_FILE_LIMIT = Memory("32m")
|
DEFAULT_FILE_LIMIT = Memory("32m")
|
||||||
DEFAULT_CASE_SCORE = 5
|
|
||||||
|
|
||||||
JOJ3_CONFIG_ROOT = Path("/home/tt/.config/joj")
|
JOJ3_CONFIG_ROOT = Path("/home/tt/.config/joj")
|
||||||
TEAPOT_CONFIG_ROOT = Path("/home/tt/.config/teapot")
|
TEAPOT_CONFIG_ROOT = Path("/home/tt/.config/teapot")
|
||||||
|
|
|
@ -51,6 +51,7 @@ class Outputs(BaseModel):
|
||||||
|
|
||||||
class ParserDiff(BaseModel):
|
class ParserDiff(BaseModel):
|
||||||
output: Outputs = Outputs()
|
output: Outputs = Outputs()
|
||||||
|
default_score: int = 5
|
||||||
|
|
||||||
|
|
||||||
class Files(BaseModel):
|
class Files(BaseModel):
|
||||||
|
|
|
@ -226,11 +226,21 @@ def fix_diff(
|
||||||
cmd = result.OptionalCmd(
|
cmd = result.OptionalCmd(
|
||||||
stdin=result.LocalFile(src=str(base_dir / f"{case}.in"))
|
stdin=result.LocalFile(src=str(base_dir / f"{case}.in"))
|
||||||
)
|
)
|
||||||
|
if cmd.args == executor.with_.default.args:
|
||||||
|
cmd.args = None
|
||||||
|
if cmd.cpu_limit == executor.with_.default.cpu_limit:
|
||||||
|
cmd.cpu_limit = None
|
||||||
|
if cmd.clock_limit == executor.with_.default.clock_limit:
|
||||||
|
cmd.clock_limit = None
|
||||||
|
if cmd.memory_limit == executor.with_.default.memory_limit:
|
||||||
|
cmd.memory_limit = None
|
||||||
|
if cmd.proc_limit == executor.with_.default.proc_limit:
|
||||||
|
cmd.proc_limit = None
|
||||||
stage_cases.append(cmd)
|
stage_cases.append(cmd)
|
||||||
parser_case = result.DiffCasesConfig(
|
parser_case = result.DiffCasesConfig(
|
||||||
outputs=[
|
outputs=[
|
||||||
result.DiffOutputConfig(
|
result.DiffOutputConfig(
|
||||||
score=const.DEFAULT_CASE_SCORE,
|
score=task_stage.diff.default_score,
|
||||||
file_name="stdout",
|
file_name="stdout",
|
||||||
answer_path=str(base_dir / f"{case}.out"),
|
answer_path=str(base_dir / f"{case}.out"),
|
||||||
)
|
)
|
||||||
|
|
|
@ -219,7 +219,7 @@
|
||||||
{
|
{
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"score": 5,
|
"score": 100,
|
||||||
"fileName": "stdout",
|
"fileName": "stdout",
|
||||||
"answerPath": "/home/tt/.config/joj/diff/case2.out",
|
"answerPath": "/home/tt/.config/joj/diff/case2.out",
|
||||||
"forceQuitOnDiff": false,
|
"forceQuitOnDiff": false,
|
||||||
|
@ -231,7 +231,7 @@
|
||||||
{
|
{
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"score": 5,
|
"score": 100,
|
||||||
"fileName": "stdout",
|
"fileName": "stdout",
|
||||||
"answerPath": "/home/tt/.config/joj/diff/case3.out",
|
"answerPath": "/home/tt/.config/joj/diff/case3.out",
|
||||||
"forceQuitOnDiff": false,
|
"forceQuitOnDiff": false,
|
||||||
|
@ -243,7 +243,7 @@
|
||||||
{
|
{
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"score": 5,
|
"score": 100,
|
||||||
"fileName": "stdout",
|
"fileName": "stdout",
|
||||||
"answerPath": "/home/tt/.config/joj/diff/task1/case4.out",
|
"answerPath": "/home/tt/.config/joj/diff/task1/case4.out",
|
||||||
"forceQuitOnDiff": false,
|
"forceQuitOnDiff": false,
|
||||||
|
@ -255,7 +255,7 @@
|
||||||
{
|
{
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"score": 5,
|
"score": 100,
|
||||||
"fileName": "stdout",
|
"fileName": "stdout",
|
||||||
"answerPath": "/home/tt/.config/joj/diff/task2/case6.out",
|
"answerPath": "/home/tt/.config/joj/diff/task2/case6.out",
|
||||||
"forceQuitOnDiff": false,
|
"forceQuitOnDiff": false,
|
||||||
|
@ -267,7 +267,7 @@
|
||||||
{
|
{
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"score": 5,
|
"score": 100,
|
||||||
"fileName": "stdout",
|
"fileName": "stdout",
|
||||||
"answerPath": "/home/tt/.config/joj/diff/task2/case7.out",
|
"answerPath": "/home/tt/.config/joj/diff/task2/case7.out",
|
||||||
"forceQuitOnDiff": false,
|
"forceQuitOnDiff": false,
|
||||||
|
@ -279,7 +279,7 @@
|
||||||
{
|
{
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"score": 5,
|
"score": 100,
|
||||||
"fileName": "stdout",
|
"fileName": "stdout",
|
||||||
"answerPath": "/home/tt/.config/joj/diff/task2/case8.out",
|
"answerPath": "/home/tt/.config/joj/diff/task2/case8.out",
|
||||||
"forceQuitOnDiff": false,
|
"forceQuitOnDiff": false,
|
||||||
|
|
|
@ -14,6 +14,8 @@ parsers = [ "diff", "result-detail" ]
|
||||||
result-detail.exitstatus = true
|
result-detail.exitstatus = true
|
||||||
result-detail.stderr = true
|
result-detail.stderr = true
|
||||||
|
|
||||||
|
diff.default_score = 100
|
||||||
|
|
||||||
# will be removed as long as the name is fixed
|
# will be removed as long as the name is fixed
|
||||||
case0.diff.output.score = 5
|
case0.diff.output.score = 5
|
||||||
case0.limit.cpu = "1s"
|
case0.limit.cpu = "1s"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user