dlai-grader 2.0b2__tar.gz → 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dlai-grader might be problematic. Click here for more details.
- {dlai_grader-2.0b2/dlai_grader.egg-info → dlai_grader-2.1.0}/PKG-INFO +1 -1
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/__init__.py +1 -1
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/io.py +9 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/Makefile +5 -2
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/entry_py/solution_n_file_n.py +9 -4
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/entry_py/solution_n_file_y.py +16 -6
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/entry_py/solution_y_file_n.py +9 -4
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/entry_py/solution_y_file_y.py +17 -7
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/grader.py +2 -3
- dlai_grader-2.1.0/dlai_grader/templates/submission.ipynb +45 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates.py +74 -47
- {dlai_grader-2.0b2 → dlai_grader-2.1.0/dlai_grader.egg-info}/PKG-INFO +1 -1
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader.egg-info/SOURCES.txt +1 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/pyproject.toml +1 -1
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/setup.py +1 -1
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/LICENSE +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/MANIFEST.in +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/README.md +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/cli.py +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/compiler.py +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/config.py +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/grading.py +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/notebook.py +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/copy_assignment_sh/extrafile_n +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/copy_assignment_sh/extrafile_y +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/dockerfile/data_n_solution_n +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/dockerfile/data_n_solution_y +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/dockerfile/data_y_solution_n +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/dockerfile/data_y_solution_y +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/types.py +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader.egg-info/dependency_links.txt +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader.egg-info/entry_points.txt +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader.egg-info/requires.txt +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader.egg-info/top_level.txt +0 -0
- {dlai_grader-2.0b2 → dlai_grader-2.1.0}/setup.cfg +0 -0
|
@@ -257,6 +257,15 @@ def init_grader() -> None:
|
|
|
257
257
|
os.makedirs("mount")
|
|
258
258
|
os.makedirs("submission")
|
|
259
259
|
|
|
260
|
+
extra_file_name = template_dict["extra_file_name"]
|
|
261
|
+
if extra_file_name:
|
|
262
|
+
write_file_from_template(f"./learner/{extra_file_name}", "")
|
|
263
|
+
write_file_from_template(f"./mount/{extra_file_name}", "")
|
|
264
|
+
|
|
265
|
+
write_file_from_template(
|
|
266
|
+
"./mount/submission.ipynb", template_dict["submission_ipynb"]
|
|
267
|
+
)
|
|
268
|
+
|
|
260
269
|
if "COPY data/ /grader/data/" in template_dict["dockerfile"]:
|
|
261
270
|
os.makedirs("data")
|
|
262
271
|
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
include .conf
|
|
4
4
|
|
|
5
5
|
PARTIDS = 123 456
|
|
6
|
+
COURSERA_PARTIDS = "123 456"
|
|
7
|
+
|
|
6
8
|
OS := $(shell uname)
|
|
7
9
|
|
|
8
10
|
sync:
|
|
@@ -12,7 +14,8 @@ sync:
|
|
|
12
14
|
|
|
13
15
|
learner:
|
|
14
16
|
dlai_grader --learner --output_notebook=./learner/$(ASSIGNMENT_NAME).ipynb
|
|
15
|
-
|
|
17
|
+
jupyter nbconvert --clear-output --inplace ./learner/$(ASSIGNMENT_NAME).ipynb
|
|
18
|
+
# rsync -a --exclude="submission.ipynb" --exclude="__pycache__" --exclude=".*" ./mount/ ./learner/
|
|
16
19
|
|
|
17
20
|
build:
|
|
18
21
|
docker build -t $(IMAGE_NAME):$(TAG_ID) .
|
|
@@ -48,7 +51,7 @@ upgrade:
|
|
|
48
51
|
dlai_grader --upgrade
|
|
49
52
|
|
|
50
53
|
coursera:
|
|
51
|
-
dlai_grader --grade --partids
|
|
54
|
+
dlai_grader --grade --partids=$(COURSERA_PARTIDS) --docker=$(IMAGE_NAME):$(TAG_ID) --memory=$(MEMORY_LIMIT) --submission=$(SUB_DIR)
|
|
52
55
|
|
|
53
56
|
zip:
|
|
54
57
|
zip -r $(IMAGE_NAME)$(TAG_ID).zip .
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import traceback
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
from grader import handle_part_id
|
|
4
|
+
|
|
3
5
|
from dlai_grader.compiler import compile_partial_module
|
|
4
|
-
from dlai_grader.
|
|
5
|
-
from dlai_grader.notebook import keep_tagged_cells
|
|
6
|
+
from dlai_grader.config import Config, get_part_id
|
|
6
7
|
from dlai_grader.grading import compute_grading_score, graded_obj_missing
|
|
7
|
-
from
|
|
8
|
+
from dlai_grader.io import copy_submission_to_workdir, read_notebook, send_feedback
|
|
9
|
+
from dlai_grader.notebook import keep_tagged_cells
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
def notebook_grading(config, compile_solution=False):
|
|
@@ -15,6 +17,7 @@ def notebook_grading(config, compile_solution=False):
|
|
|
15
17
|
send_feedback(0.0, msg, err=True)
|
|
16
18
|
|
|
17
19
|
transformations = [keep_tagged_cells()]
|
|
20
|
+
|
|
18
21
|
for t in transformations:
|
|
19
22
|
nb = t(nb)
|
|
20
23
|
|
|
@@ -27,8 +30,10 @@ def notebook_grading(config, compile_solution=False):
|
|
|
27
30
|
solution_mod = None
|
|
28
31
|
if compile_solution:
|
|
29
32
|
solution_nb = read_notebook(config.solution_file_path)
|
|
33
|
+
|
|
30
34
|
for t in transformations:
|
|
31
35
|
solution_nb = t(solution_nb)
|
|
36
|
+
|
|
32
37
|
solution_mod = compile_partial_module(
|
|
33
38
|
solution_nb,
|
|
34
39
|
"solution_mod",
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import traceback
|
|
2
|
-
from
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from grader import handle_part_id
|
|
5
|
+
|
|
3
6
|
from dlai_grader.compiler import compile_partial_module
|
|
4
|
-
from dlai_grader.
|
|
5
|
-
from dlai_grader.notebook import keep_tagged_cells
|
|
7
|
+
from dlai_grader.config import Config, get_part_id
|
|
6
8
|
from dlai_grader.grading import (
|
|
9
|
+
LearnerSubmission,
|
|
7
10
|
compute_grading_score,
|
|
8
11
|
graded_obj_missing,
|
|
9
|
-
LearnerSubmission,
|
|
10
12
|
)
|
|
11
|
-
from
|
|
13
|
+
from dlai_grader.io import copy_submission_to_workdir, read_notebook, send_feedback
|
|
14
|
+
from dlai_grader.notebook import keep_tagged_cells
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
def notebook_grading(config, compile_solution=False):
|
|
@@ -19,6 +22,7 @@ def notebook_grading(config, compile_solution=False):
|
|
|
19
22
|
send_feedback(0.0, msg, err=True)
|
|
20
23
|
|
|
21
24
|
transformations = [keep_tagged_cells()]
|
|
25
|
+
|
|
22
26
|
for t in transformations:
|
|
23
27
|
nb = t(nb)
|
|
24
28
|
|
|
@@ -31,8 +35,10 @@ def notebook_grading(config, compile_solution=False):
|
|
|
31
35
|
solution_mod = None
|
|
32
36
|
if compile_solution:
|
|
33
37
|
solution_nb = read_notebook(config.solution_file_path)
|
|
38
|
+
|
|
34
39
|
for t in transformations:
|
|
35
40
|
solution_nb = t(solution_nb)
|
|
41
|
+
|
|
36
42
|
solution_mod = compile_partial_module(
|
|
37
43
|
solution_nb,
|
|
38
44
|
"solution_mod",
|
|
@@ -43,6 +49,10 @@ def notebook_grading(config, compile_solution=False):
|
|
|
43
49
|
|
|
44
50
|
|
|
45
51
|
def non_notebook_grading(config):
|
|
52
|
+
if Path(config.submission_file_path).stat().st_size == 0:
|
|
53
|
+
msg = "Dummy file detected. Make sure you saved the correct file before submitting."
|
|
54
|
+
send_feedback(0.0, msg, err=True)
|
|
55
|
+
|
|
46
56
|
try:
|
|
47
57
|
with open(config.submission_file_path, "r") as file:
|
|
48
58
|
contents = file.read()
|
|
@@ -57,7 +67,7 @@ def main() -> None:
|
|
|
57
67
|
part_id = get_part_id()
|
|
58
68
|
|
|
59
69
|
match part_id:
|
|
60
|
-
case "
|
|
70
|
+
case "456":
|
|
61
71
|
copy_submission_to_workdir(file_name="{{EXTRA_FILE_NAME}}")
|
|
62
72
|
c = Config(submission_file="{{EXTRA_FILE_NAME}}")
|
|
63
73
|
learner_mod = non_notebook_grading(c)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import traceback
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
from grader import handle_part_id
|
|
4
|
+
|
|
3
5
|
from dlai_grader.compiler import compile_partial_module
|
|
4
|
-
from dlai_grader.
|
|
5
|
-
from dlai_grader.notebook import keep_tagged_cells
|
|
6
|
+
from dlai_grader.config import Config, get_part_id
|
|
6
7
|
from dlai_grader.grading import compute_grading_score, graded_obj_missing
|
|
7
|
-
from
|
|
8
|
+
from dlai_grader.io import copy_submission_to_workdir, read_notebook, send_feedback
|
|
9
|
+
from dlai_grader.notebook import keep_tagged_cells
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
def notebook_grading(config, compile_solution=False):
|
|
@@ -15,6 +17,7 @@ def notebook_grading(config, compile_solution=False):
|
|
|
15
17
|
send_feedback(0.0, msg, err=True)
|
|
16
18
|
|
|
17
19
|
transformations = [keep_tagged_cells()]
|
|
20
|
+
|
|
18
21
|
for t in transformations:
|
|
19
22
|
nb = t(nb)
|
|
20
23
|
|
|
@@ -27,8 +30,10 @@ def notebook_grading(config, compile_solution=False):
|
|
|
27
30
|
solution_mod = None
|
|
28
31
|
if compile_solution:
|
|
29
32
|
solution_nb = read_notebook(config.solution_file_path)
|
|
33
|
+
|
|
30
34
|
for t in transformations:
|
|
31
35
|
solution_nb = t(solution_nb)
|
|
36
|
+
|
|
32
37
|
solution_mod = compile_partial_module(
|
|
33
38
|
solution_nb,
|
|
34
39
|
"solution_mod",
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import traceback
|
|
2
|
-
from
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from grader import handle_part_id
|
|
5
|
+
|
|
3
6
|
from dlai_grader.compiler import compile_partial_module
|
|
4
|
-
from dlai_grader.
|
|
5
|
-
from dlai_grader.notebook import keep_tagged_cells
|
|
7
|
+
from dlai_grader.config import Config, get_part_id
|
|
6
8
|
from dlai_grader.grading import (
|
|
9
|
+
LearnerSubmission,
|
|
7
10
|
compute_grading_score,
|
|
8
11
|
graded_obj_missing,
|
|
9
|
-
LearnerSubmission,
|
|
10
12
|
)
|
|
11
|
-
from
|
|
13
|
+
from dlai_grader.io import copy_submission_to_workdir, read_notebook, send_feedback
|
|
14
|
+
from dlai_grader.notebook import keep_tagged_cells
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
def notebook_grading(config, compile_solution=False):
|
|
@@ -19,6 +22,7 @@ def notebook_grading(config, compile_solution=False):
|
|
|
19
22
|
send_feedback(0.0, msg, err=True)
|
|
20
23
|
|
|
21
24
|
transformations = [keep_tagged_cells()]
|
|
25
|
+
|
|
22
26
|
for t in transformations:
|
|
23
27
|
nb = t(nb)
|
|
24
28
|
|
|
@@ -31,8 +35,10 @@ def notebook_grading(config, compile_solution=False):
|
|
|
31
35
|
solution_mod = None
|
|
32
36
|
if compile_solution:
|
|
33
37
|
solution_nb = read_notebook(config.solution_file_path)
|
|
38
|
+
|
|
34
39
|
for t in transformations:
|
|
35
40
|
solution_nb = t(solution_nb)
|
|
41
|
+
|
|
36
42
|
solution_mod = compile_partial_module(
|
|
37
43
|
solution_nb,
|
|
38
44
|
"solution_mod",
|
|
@@ -43,6 +49,10 @@ def notebook_grading(config, compile_solution=False):
|
|
|
43
49
|
|
|
44
50
|
|
|
45
51
|
def non_notebook_grading(config):
|
|
52
|
+
if Path(config.submission_file_path).stat().st_size == 0:
|
|
53
|
+
msg = "Dummy file detected. Make sure you saved the correct file before submitting."
|
|
54
|
+
send_feedback(0.0, msg, err=True)
|
|
55
|
+
|
|
46
56
|
try:
|
|
47
57
|
with open(config.submission_file_path, "r") as file:
|
|
48
58
|
contents = file.read()
|
|
@@ -57,10 +67,10 @@ def main() -> None:
|
|
|
57
67
|
part_id = get_part_id()
|
|
58
68
|
|
|
59
69
|
match part_id:
|
|
60
|
-
case "
|
|
70
|
+
case "456":
|
|
61
71
|
copy_submission_to_workdir(file_name="{{EXTRA_FILE_NAME}}")
|
|
62
72
|
c = Config(submission_file="{{EXTRA_FILE_NAME}}")
|
|
63
|
-
learner_mod = non_notebook_grading(c)
|
|
73
|
+
learner_mod, solution_mod = non_notebook_grading(c), None
|
|
64
74
|
case _:
|
|
65
75
|
copy_submission_to_workdir()
|
|
66
76
|
c = Config()
|
|
@@ -9,7 +9,6 @@ def part_1(
|
|
|
9
9
|
) -> grading_function:
|
|
10
10
|
@object_to_grade(learner_mod, "learner_func")
|
|
11
11
|
def g(learner_func: FunctionType) -> list[test_case]:
|
|
12
|
-
|
|
13
12
|
cases: list[test_case] = []
|
|
14
13
|
|
|
15
14
|
t = test_case()
|
|
@@ -27,6 +26,6 @@ def part_1(
|
|
|
27
26
|
|
|
28
27
|
def handle_part_id(part_id: str) -> grading_wrapper:
|
|
29
28
|
grader_dict: dict[str, grading_wrapper] = {
|
|
30
|
-
"": part_1,
|
|
29
|
+
"123": part_1,
|
|
31
30
|
}
|
|
32
|
-
return grader_dict[part_id]
|
|
31
|
+
return grader_dict[part_id]
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "markdown",
|
|
5
|
+
"id": "60acce47",
|
|
6
|
+
"metadata": {},
|
|
7
|
+
"source": [
|
|
8
|
+
"## Replace dummy submission with actual assignment"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"cell_type": "code",
|
|
13
|
+
"execution_count": null,
|
|
14
|
+
"id": "ecf4869a",
|
|
15
|
+
"metadata": {
|
|
16
|
+
"deletable": false,
|
|
17
|
+
"tags": [
|
|
18
|
+
"graded"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"outputs": [],
|
|
22
|
+
"source": [
|
|
23
|
+
"# GRADED FUNCTION: learner_func\n",
|
|
24
|
+
"\n",
|
|
25
|
+
"\n",
|
|
26
|
+
"def learner_func():\n",
|
|
27
|
+
" return \"dummy submission\""
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"metadata": {
|
|
32
|
+
"grader_version": "1",
|
|
33
|
+
"kernelspec": {
|
|
34
|
+
"display_name": "adlp",
|
|
35
|
+
"language": "python",
|
|
36
|
+
"name": "python3"
|
|
37
|
+
},
|
|
38
|
+
"language_info": {
|
|
39
|
+
"name": "python",
|
|
40
|
+
"version": "3.11.13"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"nbformat": 4,
|
|
44
|
+
"nbformat_minor": 5
|
|
45
|
+
}
|
|
@@ -138,6 +138,17 @@ def copy_grader_py() -> str:
|
|
|
138
138
|
return src.read_text(encoding="utf-8")
|
|
139
139
|
|
|
140
140
|
|
|
141
|
+
def copy_submission_ipynb() -> str:
|
|
142
|
+
base_dir = Path(__file__).parent
|
|
143
|
+
src = base_dir / "templates" / "submission.ipynb"
|
|
144
|
+
|
|
145
|
+
if not src.exists():
|
|
146
|
+
raise FileNotFoundError(f"Template not found: {src}")
|
|
147
|
+
|
|
148
|
+
# shutil.copy(src, dst)
|
|
149
|
+
return src.read_text(encoding="utf-8")
|
|
150
|
+
|
|
151
|
+
|
|
141
152
|
def load_templates() -> dict[str, str]:
|
|
142
153
|
specialization = input("Name of the specialization: ")
|
|
143
154
|
course = input("Number of the course: ")
|
|
@@ -159,30 +170,31 @@ def load_templates() -> dict[str, str]:
|
|
|
159
170
|
unit_test_filename = unit_test_filename if unit_test_filename else "unittests"
|
|
160
171
|
# version = input("Version of the grader (leave empty for version 1): ")
|
|
161
172
|
version = "1"
|
|
162
|
-
data_dir_required = input(
|
|
163
|
-
"Do you require a data dir? y/n (leave empty for n): "
|
|
164
|
-
)
|
|
165
|
-
data_dir_required = data_dir_required if data_dir_required else "n"
|
|
166
|
-
|
|
167
|
-
if data_dir_required not in ["y", "n"]:
|
|
168
|
-
print("invalid option selected")
|
|
169
|
-
sys.exit(1)
|
|
170
173
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
data_dir_required = ""
|
|
175
|
+
while data_dir_required not in ["y", "n"]:
|
|
176
|
+
data_dir_required = input(
|
|
177
|
+
"Do you require a data dir? y/n (leave empty for n): ",
|
|
178
|
+
)
|
|
179
|
+
if data_dir_required == "":
|
|
180
|
+
data_dir_required = "n"
|
|
181
|
+
# data_dir_required = data_dir_required if data_dir_required else "n"
|
|
182
|
+
|
|
183
|
+
sol_dir_required = ""
|
|
184
|
+
while sol_dir_required not in ["y", "n"]:
|
|
185
|
+
sol_dir_required = input(
|
|
186
|
+
"Do you require a solution file? y/n (leave empty for n): ",
|
|
187
|
+
)
|
|
188
|
+
if sol_dir_required == "":
|
|
189
|
+
sol_dir_required = "n"
|
|
178
190
|
|
|
179
|
-
non_notebook_grading =
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
191
|
+
non_notebook_grading = ""
|
|
192
|
+
while non_notebook_grading not in ["y", "n"]:
|
|
193
|
+
non_notebook_grading = input(
|
|
194
|
+
"Will you grade a file different from a notebook? y/n (leave empty for n): ",
|
|
195
|
+
)
|
|
196
|
+
if non_notebook_grading == "":
|
|
197
|
+
non_notebook_grading = "n"
|
|
186
198
|
|
|
187
199
|
extra_file_name = ""
|
|
188
200
|
if non_notebook_grading == "y":
|
|
@@ -190,17 +202,17 @@ def load_templates() -> dict[str, str]:
|
|
|
190
202
|
"Name of the extra file to grade: ",
|
|
191
203
|
)
|
|
192
204
|
|
|
193
|
-
cpus =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
sys.exit(1)
|
|
205
|
+
cpus = ""
|
|
206
|
+
while cpus not in ["0.25", "0.5", "0.75", "1"]:
|
|
207
|
+
cpus = input("CPU Units (leave empty for 0.25): ")
|
|
208
|
+
if cpus == "":
|
|
209
|
+
cpus = "0.25"
|
|
199
210
|
|
|
200
|
-
|
|
201
|
-
|
|
211
|
+
if cpus not in ["0.25", "0.5", "0.75", "1"]:
|
|
212
|
+
print(f"Options are: {['0.25', '0.5', '0.75', '1']}")
|
|
202
213
|
|
|
203
|
-
|
|
214
|
+
soft_memory = ""
|
|
215
|
+
soft_memory_options = [
|
|
204
216
|
"512m",
|
|
205
217
|
"768m",
|
|
206
218
|
"1024m",
|
|
@@ -211,14 +223,17 @@ def load_templates() -> dict[str, str]:
|
|
|
211
223
|
"2g",
|
|
212
224
|
"4g",
|
|
213
225
|
"8g",
|
|
214
|
-
]
|
|
215
|
-
|
|
216
|
-
|
|
226
|
+
]
|
|
227
|
+
while soft_memory not in soft_memory_options:
|
|
228
|
+
soft_memory = input("Memory Reservation (leave empty for 512m): ")
|
|
229
|
+
if soft_memory == "":
|
|
230
|
+
soft_memory = "512m"
|
|
217
231
|
|
|
218
|
-
|
|
219
|
-
|
|
232
|
+
if soft_memory not in soft_memory_options:
|
|
233
|
+
print(f"Options are: {soft_memory_options}")
|
|
220
234
|
|
|
221
|
-
|
|
235
|
+
hard_memory = ""
|
|
236
|
+
hard_memory_options = [
|
|
222
237
|
"1024m",
|
|
223
238
|
"2048m",
|
|
224
239
|
"4096m",
|
|
@@ -229,9 +244,14 @@ def load_templates() -> dict[str, str]:
|
|
|
229
244
|
"4g",
|
|
230
245
|
"8g",
|
|
231
246
|
"15g",
|
|
232
|
-
]
|
|
233
|
-
|
|
234
|
-
|
|
247
|
+
]
|
|
248
|
+
while hard_memory not in hard_memory_options:
|
|
249
|
+
hard_memory = input("Memory Limit (leave empty for 1g): ")
|
|
250
|
+
if hard_memory == "":
|
|
251
|
+
hard_memory = "1g"
|
|
252
|
+
|
|
253
|
+
if hard_memory not in hard_memory_options:
|
|
254
|
+
print(f"Options are: {hard_memory_options}")
|
|
235
255
|
|
|
236
256
|
if grader_mvp == "y":
|
|
237
257
|
unit_test_filename = "unittests"
|
|
@@ -257,23 +277,25 @@ def load_templates() -> dict[str, str]:
|
|
|
257
277
|
TAG_ID=V$(GRADER_VERSION)
|
|
258
278
|
SUB_DIR=mount
|
|
259
279
|
MEMORY_LIMIT=4096
|
|
260
|
-
HARD_MEMORY={hard_memory}
|
|
261
280
|
CPUS={cpus}
|
|
262
281
|
SOFT_MEMORY={soft_memory}
|
|
282
|
+
HARD_MEMORY={hard_memory}
|
|
263
283
|
"""
|
|
264
284
|
|
|
265
|
-
|
|
285
|
+
assignment_name = f"C{course}M{module}_Assignment.ipynb"
|
|
266
286
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
287
|
+
copy_assignment_to_submission_sh = generate_copy_assignment_script(
|
|
288
|
+
extra_file_required=non_notebook_grading,
|
|
289
|
+
assignment_name=assignment_name,
|
|
290
|
+
extra_file_name=extra_file_name,
|
|
291
|
+
)
|
|
272
292
|
|
|
273
293
|
makefile = copy_makefile()
|
|
274
294
|
|
|
275
295
|
grader_py = copy_grader_py()
|
|
276
296
|
|
|
297
|
+
submission_ipynb = copy_submission_ipynb()
|
|
298
|
+
|
|
277
299
|
entry_py = copy_entry_script(
|
|
278
300
|
sol_dir_required=sol_dir_required,
|
|
279
301
|
non_notebook_grading=non_notebook_grading,
|
|
@@ -286,7 +308,12 @@ def load_templates() -> dict[str, str]:
|
|
|
286
308
|
"conf": dedent(conf[1:]),
|
|
287
309
|
"grader_py": dedent(grader_py),
|
|
288
310
|
"entry_py": dedent(entry_py),
|
|
311
|
+
"extra_file_name": extra_file_name,
|
|
312
|
+
"submission_ipynb": submission_ipynb,
|
|
289
313
|
# "copy_assignment_to_submission_sh": dedent(copy_assignment_to_submission_sh),
|
|
290
314
|
}
|
|
291
315
|
|
|
316
|
+
if extra_file_name:
|
|
317
|
+
template_dict.update({"extra_file_name": extra_file_name})
|
|
318
|
+
|
|
292
319
|
return template_dict
|
|
@@ -20,6 +20,7 @@ dlai_grader.egg-info/requires.txt
|
|
|
20
20
|
dlai_grader.egg-info/top_level.txt
|
|
21
21
|
dlai_grader/templates/Makefile
|
|
22
22
|
dlai_grader/templates/grader.py
|
|
23
|
+
dlai_grader/templates/submission.ipynb
|
|
23
24
|
dlai_grader/templates/copy_assignment_sh/extrafile_n
|
|
24
25
|
dlai_grader/templates/copy_assignment_sh/extrafile_y
|
|
25
26
|
dlai_grader/templates/dockerfile/data_n_solution_n
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/copy_assignment_sh/extrafile_n
RENAMED
|
File without changes
|
{dlai_grader-2.0b2 → dlai_grader-2.1.0}/dlai_grader/templates/copy_assignment_sh/extrafile_y
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|