Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
ImogenBits committed Dec 26, 2023
1 parent 5272516 commit 0dcf51b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion algobattle/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,17 @@
from algobattle.match import AlgobattleConfig, EmptyUi, Match, MatchConfig, MatchupStr, Ui, ProjectConfig
from algobattle.problem import Instance, Problem, Solution
from algobattle.program import Generator, Matchup, Solver
from algobattle.util import BuildError, DockerNotRunning, EncodableModel, ExceptionInfo, Role, RunningTimer, BaseModel, TempDir, timestamp
from algobattle.util import (
BuildError,
DockerNotRunning,
EncodableModel,
ExceptionInfo,
Role,
RunningTimer,
BaseModel,
TempDir,
timestamp,
)
from algobattle.templates import Language, PartialTemplateArgs, TemplateArgs, write_problem_template, write_templates


Expand Down
4 changes: 3 additions & 1 deletion algobattle/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,9 @@ def __get_pydantic_core_schema__(cls, source: type[BaseModel], handler: GetCoreS
def validate_with_self(input: object, validate: ValidatorFunctionWrapHandler, info: ValidationInfo) -> Self:
self: Self = validate(input)
if info.context is None or "self" not in info.context:
self = cast(Self, cls.model_validate(input, context=(info.context or {}) | {"self": self, model_type: self}))
self = cast(
Self, cls.model_validate(input, context=(info.context or {}) | {"self": self, model_type: self})
)
return self

schema = with_info_wrap_validator_function(validate_with_self, schema)
Expand Down

0 comments on commit 0dcf51b

Please sign in to comment.