dev #10
|
@ -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
|
||||
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
张泊明518370910136
commented
also these also these `Optional`?
李衍志523370910113
commented
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
张泊明518370910136
commented
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
李衍志523370910113
commented
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(
|
||||
|
|
|
@ -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
张泊明518370910136
commented
`ParserEnum`
|
||||
|
||||
|
@ -78,11 +79,15 @@ def get_executor_with(
|
|||
copy_out=copy_out_files,
|
||||
jon-lee marked this conversation as resolved
Outdated
张泊明518370910136
commented
is there a conclusion now? or it should have a prefix is there a conclusion now? or it should have a prefix `TODO: `?
李衍志523370910113
commented
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.
张泊明518370910136
commented
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
张泊明518370910136
commented
is it in the correct unit? is it in the correct unit?
Give all the fields in `Limit` a default value and make it non optional in task_stage.limit
李衍志523370910113
commented
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=[],
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user
Are these
Optional
necessary?