dev #10

Merged
李衍志523370910113 merged 238 commits from dev into master 2025-03-05 16:20:39 +08:00
2 changed files with 13 additions and 8 deletions
Showing only changes of commit deb90a02ca - Show all commits

View File

@ -132,7 +132,7 @@ class Parser(BaseModel):
def validate_with(cls, v: Any) -> Dict[str, Any]:
if isinstance(v, BaseModel):
return v.model_dump(by_alias=True)
raise ValueError(f"Must be a BaseModel instance")
raise ValueError("Must be a BaseModel instance")
class StageDetail(BaseModel):
@ -168,7 +168,7 @@ class Config(BaseModel):
class DummyConfig(BaseModel):
score: Optional[int] = None
score: int = 0
jon-lee marked this conversation as resolved Outdated

Are these Optional necessary?

Are these `Optional` necessary?
comment: Optional[str] = None
force_quit_on_not_accepted: Optional[bool] = Field(
False, serialization_alias="forceQuitOnNotAccepted"
@ -176,7 +176,7 @@ class DummyConfig(BaseModel):
class DiffOutputConfig(BaseModel):
jon-lee marked this conversation as resolved

also these Optional?

also these `Optional`?

I guess some of the field have default within JOJ3, so I choose optional just to reduce the length of json previously

I guess some of the field have default within JOJ3, so I choose optional just to reduce the length of json previously

better put all defaults here then we only need to check the code here

better put all defaults here then we only need to check the code here

indeed.

indeed.
score: Optional[int] = None
score: int = 100
file_name: str = Field("", serialization_alias="fileName")
answer_path: str = Field("", serialization_alias="answerPath")
force_quit_on_diff: Optional[bool] = Field(

View File

@ -4,6 +4,7 @@ from pathlib import Path
from typing import Any, Callable, Dict, List, Tuple
from joj3_config_generator.models import result, task
from joj3_config_generator.models.common import Memory, Time
from joj3_config_generator.models.const import JOJ3_CONFIG_ROOT
jon-lee marked this conversation as resolved Outdated

ParserEnum

`ParserEnum`
@ -78,11 +79,15 @@ def get_executor_with(
copy_out=copy_out_files,
jon-lee marked this conversation as resolved Outdated

is there a conclusion now? or it should have a prefix TODO: ?

is there a conclusion now? or it should have a prefix `TODO: `?

so far works fine on 280 sides, indicating that pbs in 151 can be resolved with proper guidelines I think.

so far works fine on 280 sides, indicating that pbs in 151 can be resolved with proper guidelines I think.

ok, then add that prefix

ok, then add that prefix
copy_in_cached={file: file for file in cached},
jon-lee marked this conversation as resolved Outdated

is it in the correct unit?
Give all the fields in Limit a default value and make it non optional in task_stage.limit

is it in the correct unit? Give all the fields in `Limit` a default value and make it non optional in task_stage.limit

resolved

resolved
copy_out_cached=file_export,
cpu_limit=task_stage.limit.cpu,
clock_limit=2 * task_stage.limit.cpu,
memory_limit=task_stage.limit.mem,
stderr=result.Collector(name="stderr"),
stdout=result.Collector(name="stdout"),
cpu_limit=Time(task_stage.limit.cpu),
clock_limit=2 * Time(task_stage.limit.cpu),
memory_limit=Memory(task_stage.limit.mem),
stderr=result.Collector(
name="stderr", pipe=True, max=Memory(task_stage.limit.stderr)
),
stdout=result.Collector(
name="stdout", pipe=True, max=Memory(task_stage.limit.stdout)
),
),
cases=[],
)