Skip to content

Commit 44ae6dd

Browse files
martinjonasMartin Jonáš
andauthored
Remove aws_repository from the submission data class (fixes #173). (#174)
* Remove aws_repository from the submission data class. * Minor formatting fixes. * Fix aws submission template. * Rename AWS template file. --------- Co-authored-by: Martin Jonáš <martin.jonas@mail.muni.cz>
1 parent 4d98944 commit 44ae6dd

File tree

3 files changed

+9
-34
lines changed

3 files changed

+9
-34
lines changed

smtcomp/defs.py

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,8 +1227,6 @@ class Participation(BaseModel, extra="forbid"):
12271227
divisions: add all the logics of those divisions in each track
12281228
logics: add all the specified logics in each selected track it exists
12291229
1230-
aws_repository should be used only in conjunction with Cloud and Parallel track
1231-
12321230
archive and command should not be used with Cloud and Parallel track. They superseed the one given at the root.
12331231
"""
12341232

@@ -1237,18 +1235,10 @@ class Participation(BaseModel, extra="forbid"):
12371235
divisions: list[Division] = []
12381236
archive: Archive | None = None
12391237
command: Command | None = None
1240-
aws_repository: str | None = None
12411238
experimental: bool = False
12421239

12431240
@model_validator(mode="after")
12441241
def check_archive(self) -> Participation:
1245-
aws_track = {Track.Cloud, Track.Parallel}
1246-
if self.aws_repository is None and not set(self.tracks).isdisjoint(aws_track):
1247-
raise ValueError("aws_repository is required by Cloud and Parallel track")
1248-
if self.aws_repository is not None and not set(self.tracks).issubset(aws_track):
1249-
raise ValueError("aws_repository can be used only with Cloud and Parallel track")
1250-
if (self.archive is not None or self.command is not None) and not set(self.tracks).isdisjoint(aws_track):
1251-
raise ValueError("archive and command field can't be used with Cloud and Parallel track")
12521242
return self
12531243

12541244
def get(self, d: None | dict[Track, dict[Division, set[Logic]]] = None) -> dict[Track, dict[Division, set[Logic]]]:
@@ -1274,8 +1264,6 @@ def get_logics_by_track(self) -> dict[Track, set[Logic]]:
12741264
def complete(self, archive: Archive | None, command: Command | None) -> ParticipationCompleted:
12751265
archive = cast(Archive, archive if self.archive is None else self.archive)
12761266
command = cast(Command, command if self.command is None else self.command)
1277-
if (self.aws_repository is not None) or set(self.tracks).issubset({Track.Cloud, Track.Parallel}):
1278-
raise ValueError("can't complete Cloud and Parallel track participations")
12791267
return ParticipationCompleted(
12801268
tracks=self.get(), archive=archive, command=command, experimental=self.experimental
12811269
)
@@ -1339,14 +1327,10 @@ class Submission(BaseModel, extra="forbid"):
13391327

13401328
@model_validator(mode="after")
13411329
def check_archive(self) -> Submission:
1342-
if self.archive is None and not all(p.archive or p.aws_repository for p in self.participations.root):
1343-
raise ValueError(
1344-
"Field archive (or aws_repository) is needed in all participations if not present at the root"
1345-
)
1346-
if self.command is None and not all(p.command or p.aws_repository for p in self.participations.root):
1347-
raise ValueError(
1348-
"Field command (or aws_repository) is needed in all participations if not present at the root"
1349-
)
1330+
if self.archive is None and not all(p.archive for p in self.participations.root):
1331+
raise ValueError("Field archive is needed in all participations if not present at the root")
1332+
if self.command is None and not all(p.command for p in self.participations.root):
1333+
raise ValueError("Field command is needed in all participations if not present at the root")
13501334

13511335
def check_archive(archive: None | Archive) -> None:
13521336
if archive:
@@ -1364,7 +1348,7 @@ def uniq_id(self) -> str:
13641348

13651349
def complete_participations(self) -> list[ParticipationCompleted]:
13661350
"""Push defaults from the submission into participations"""
1367-
return [p.complete(self.archive, self.command) for p in self.participations.root if p.aws_repository is None]
1351+
return [p.complete(self.archive, self.command) for p in self.participations.root]
13681352

13691353

13701354
class Smt2File(BaseModel):

submissions/template/template_aws_tracks.json renamed to submissions/template/template_parallel.json

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,15 @@
66
],
77
"contacts": ["contact name <contact@email.com>"],
88
"website": "http://example.com/",
9+
"archive": { "url": "https://github.com/project/repository" },
10+
"command": ["relative_cmd", "default_command_line"],
911
"system_description": "http://example.com/system.pdf",
1012
"solver_type": "Standalone",
1113
"seed": "42",
1214
"participations": [
13-
{
14-
"tracks": ["Cloud"],
15-
"divisions": ["Equality"],
16-
"aws_repository": "https://github.com/project/repository"
17-
},
1815
{
1916
"tracks": ["Parallel"],
20-
"logics": "QF_.*LRA.*",
21-
"aws_repository": "https://github.com/project/repository"
22-
},
23-
{
24-
"tracks": ["Cloud"],
25-
"logics": ["LIA"],
26-
"aws_repository": "https://github.com/project/repository"
17+
"logics": "QF_.*LRA.*"
2718
}
2819
]
2920
}

tests/test_validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
good_cases = [
1818
"tests/test1.json",
1919
"submissions/template/template.json",
20-
"submissions/template/template_aws_tracks.json",
20+
"submissions/template/template_parallel.json",
2121
"tests/test_good_final.json",
2222
]
2323
bad_cases = ["tests/test_bad.json", "tests/test_bad_final.json"]

0 commit comments

Comments
 (0)