forked from acm-ndsu/byte_le_engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Significant progress Created all schema files and made progress in them. * Tried with schemas Tried to fix the schemas. Will need to revisit all changes on this branch. * synce server to master (#90) (#91) * Base file (#80) Made base file and folder structure. * Game generation tweak (#89) * Tweaked game generation * Tweaked game generation names * Added type * moved to actual function * cleaned up ternary * Added comments * documentation updates --------- --------- Co-authored-by: Ian <[email protected]> Co-authored-by: KingPhilip14 <[email protected]> * Fixed private issue Made team_id_uuid its own schema for privacy. --------- Co-authored-by: Jean A. Eckelberg <[email protected]>
- Loading branch information
1 parent
5ce7239
commit 951e3e7
Showing
10 changed files
with
151 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from __future__ import annotations | ||
from pydantic import BaseModel | ||
import run_schema, submission_schema | ||
|
||
|
||
class ErrorsBase(BaseModel): | ||
error_id: int | ||
run_id: int | ||
submission_id: int | ||
error_txt: str | ||
|
||
class Config: | ||
from_attributes = True | ||
|
||
|
||
class ErrorsSchema(ErrorsBase): | ||
runs_id: list[run_schema.RunBase] = [] | ||
submission_id: list[submission_schema.SubmissionBase] = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from __future__ import annotations | ||
from pydantic import BaseModel | ||
import run_schema | ||
|
||
|
||
class GroupRunBase(BaseModel): | ||
group_run_id: int | ||
start_run: str | ||
launcher_version: str | ||
runs_per_client: int | ||
is_finished: bool | ||
|
||
class Config: | ||
from_attributes = True | ||
|
||
|
||
class GroupRunSchema(GroupRunBase): | ||
runs: list[run_schema.RunBase] = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from __future__ import annotations | ||
from pydantic import BaseModel | ||
import group_run_schema, errors_schema, turn_table_schema | ||
|
||
|
||
class RunBase(BaseModel): | ||
run_id: int | ||
group_run_id: int | ||
run_time: str | ||
winner: bool | ||
player_1: int | ||
player_2: int | ||
seed: int | ||
|
||
class Config: | ||
from_attributes = True | ||
|
||
|
||
class RunSchema(RunBase): | ||
group_run: group_run_schema.GroupRunBase | ||
errors: errors_schema.ErrorsBase | ||
turn_tables: list[turn_table_schema.TurnTableBase] = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from __future__ import annotations | ||
from pydantic import BaseModel | ||
import team_schema, errors_schema | ||
|
||
|
||
class SubmissionBase(BaseModel): | ||
submission_id: int | ||
team_id_uuid: int | ||
submission_time: str | ||
file_txt: str | ||
|
||
class Config: | ||
from_attributes = True | ||
|
||
|
||
class SubmissionSchema(SubmissionBase): | ||
team_id: list[team_schema.TeamBase] = [] | ||
errors: list[errors_schema.ErrorsBase] = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from __future__ import annotations | ||
from pydantic import BaseModel | ||
import university_schema, team_type_schema, submission_schema | ||
|
||
|
||
class TeamBase(BaseModel): | ||
uni_id: int | ||
team_type_id: int | ||
team_name: str | ||
|
||
class Config: | ||
from_attributes = True | ||
|
||
|
||
class TeamIdSchema(TeamBase): | ||
team_id_uuid: int | ||
|
||
|
||
# University <-> Team: Many to One | ||
class TeamSchema(TeamBase): | ||
uni_id: int = university_schema.UniversityBase | ||
team_type_id: int = team_type_schema.TeamTypeBase | ||
submissions: list[submission_schema.SubmissionBase] = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from __future__ import annotations | ||
from pydantic import BaseModel | ||
import team_schema | ||
|
||
|
||
class TeamTypeBase(BaseModel): | ||
team_type_id: int | ||
team_type_name: str | ||
|
||
class Config: | ||
from_attributes = True | ||
|
||
|
||
class TeamTypeSchema(TeamTypeBase): | ||
teams: list[team_schema.TeamBase] = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from __future__ import annotations | ||
from pydantic import BaseModel | ||
import run_schema | ||
|
||
|
||
class TurnTableBase(BaseModel): | ||
turn_id: int | ||
turn_number: int | ||
run_id: int | ||
turn_data: str | ||
|
||
class Config: | ||
from_attributes = True | ||
|
||
|
||
class TurnTableSchema(TurnTableBase): | ||
run: run_schema.RunBase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from __future__ import annotations | ||
from pydantic import BaseModel | ||
import team_schema | ||
|
||
|
||
class UniversityBase(BaseModel): | ||
uni_id: id | ||
uni_name: str | ||
|
||
class Config: | ||
from_attributes = True | ||
|
||
|
||
# University <-> Team: Many to One | ||
class UniversitySchema(UniversityBase): | ||
teams: list[team_schema.TeamBase] = [] |