dlai-grader 2.0b2__py3-none-any.whl → 2.0b3__py3-none-any.whl
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/__init__.py +1 -1
- dlai_grader/templates/entry_py/solution_y_file_y.py +8 -6
- dlai_grader/templates.py +56 -47
- {dlai_grader-2.0b2.dist-info → dlai_grader-2.0b3.dist-info}/METADATA +1 -1
- {dlai_grader-2.0b2.dist-info → dlai_grader-2.0b3.dist-info}/RECORD +9 -9
- {dlai_grader-2.0b2.dist-info → dlai_grader-2.0b3.dist-info}/WHEEL +0 -0
- {dlai_grader-2.0b2.dist-info → dlai_grader-2.0b3.dist-info}/entry_points.txt +0 -0
- {dlai_grader-2.0b2.dist-info → dlai_grader-2.0b3.dist-info}/licenses/LICENSE +0 -0
- {dlai_grader-2.0b2.dist-info → dlai_grader-2.0b3.dist-info}/top_level.txt +0 -0
dlai_grader/__init__.py
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
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 (
|
|
8
|
+
LearnerSubmission,
|
|
7
9
|
compute_grading_score,
|
|
8
10
|
graded_obj_missing,
|
|
9
|
-
LearnerSubmission,
|
|
10
11
|
)
|
|
11
|
-
from
|
|
12
|
+
from dlai_grader.io import copy_submission_to_workdir, read_notebook, send_feedback
|
|
13
|
+
from dlai_grader.notebook import keep_tagged_cells
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
def notebook_grading(config, compile_solution=False):
|
|
@@ -60,7 +62,7 @@ def main() -> None:
|
|
|
60
62
|
case "123":
|
|
61
63
|
copy_submission_to_workdir(file_name="{{EXTRA_FILE_NAME}}")
|
|
62
64
|
c = Config(submission_file="{{EXTRA_FILE_NAME}}")
|
|
63
|
-
learner_mod = non_notebook_grading(c)
|
|
65
|
+
learner_mod, solution_mod = non_notebook_grading(c), None
|
|
64
66
|
case _:
|
|
65
67
|
copy_submission_to_workdir()
|
|
66
68
|
c = Config()
|
dlai_grader/templates.py
CHANGED
|
@@ -159,30 +159,31 @@ def load_templates() -> dict[str, str]:
|
|
|
159
159
|
unit_test_filename = unit_test_filename if unit_test_filename else "unittests"
|
|
160
160
|
# version = input("Version of the grader (leave empty for version 1): ")
|
|
161
161
|
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
162
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
163
|
+
data_dir_required = ""
|
|
164
|
+
while data_dir_required not in ["y", "n"]:
|
|
165
|
+
data_dir_required = input(
|
|
166
|
+
"Do you require a data dir? y/n (leave empty for n): ",
|
|
167
|
+
)
|
|
168
|
+
if data_dir_required == "":
|
|
169
|
+
data_dir_required = "n"
|
|
170
|
+
# data_dir_required = data_dir_required if data_dir_required else "n"
|
|
171
|
+
|
|
172
|
+
sol_dir_required = ""
|
|
173
|
+
while sol_dir_required not in ["y", "n"]:
|
|
174
|
+
sol_dir_required = input(
|
|
175
|
+
"Do you require a solution file? y/n (leave empty for n): ",
|
|
176
|
+
)
|
|
177
|
+
if sol_dir_required == "":
|
|
178
|
+
sol_dir_required = "n"
|
|
178
179
|
|
|
179
|
-
non_notebook_grading =
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
180
|
+
non_notebook_grading = ""
|
|
181
|
+
while non_notebook_grading not in ["y", "n"]:
|
|
182
|
+
non_notebook_grading = input(
|
|
183
|
+
"Will you grade a file different from a notebook? y/n (leave empty for n): ",
|
|
184
|
+
)
|
|
185
|
+
if non_notebook_grading == "":
|
|
186
|
+
non_notebook_grading = "n"
|
|
186
187
|
|
|
187
188
|
extra_file_name = ""
|
|
188
189
|
if non_notebook_grading == "y":
|
|
@@ -190,17 +191,17 @@ def load_templates() -> dict[str, str]:
|
|
|
190
191
|
"Name of the extra file to grade: ",
|
|
191
192
|
)
|
|
192
193
|
|
|
193
|
-
cpus =
|
|
194
|
-
|
|
194
|
+
cpus = ""
|
|
195
|
+
while cpus not in ["0.25", "0.5", "0.75", "1"]:
|
|
196
|
+
cpus = input("CPU Units (leave empty for 0.25): ")
|
|
197
|
+
if cpus == "":
|
|
198
|
+
cpus = "0.25"
|
|
195
199
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
sys.exit(1)
|
|
200
|
+
if cpus not in ["0.25", "0.5", "0.75", "1"]:
|
|
201
|
+
print(f"Options are: {['0.25', '0.5', '0.75', '1']}")
|
|
199
202
|
|
|
200
|
-
soft_memory =
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if soft_memory not in [
|
|
203
|
+
soft_memory = ""
|
|
204
|
+
soft_memory_options = [
|
|
204
205
|
"512m",
|
|
205
206
|
"768m",
|
|
206
207
|
"1024m",
|
|
@@ -211,14 +212,17 @@ def load_templates() -> dict[str, str]:
|
|
|
211
212
|
"2g",
|
|
212
213
|
"4g",
|
|
213
214
|
"8g",
|
|
214
|
-
]
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
]
|
|
216
|
+
while soft_memory not in soft_memory_options:
|
|
217
|
+
soft_memory = input("Memory Reservation (leave empty for 512m): ")
|
|
218
|
+
if soft_memory == "":
|
|
219
|
+
soft_memory = "512m"
|
|
217
220
|
|
|
218
|
-
|
|
219
|
-
|
|
221
|
+
if soft_memory not in soft_memory_options:
|
|
222
|
+
print(f"Options are: {soft_memory_options}")
|
|
220
223
|
|
|
221
|
-
|
|
224
|
+
hard_memory = ""
|
|
225
|
+
hard_memory_options = [
|
|
222
226
|
"1024m",
|
|
223
227
|
"2048m",
|
|
224
228
|
"4096m",
|
|
@@ -229,9 +233,14 @@ def load_templates() -> dict[str, str]:
|
|
|
229
233
|
"4g",
|
|
230
234
|
"8g",
|
|
231
235
|
"15g",
|
|
232
|
-
]
|
|
233
|
-
|
|
234
|
-
|
|
236
|
+
]
|
|
237
|
+
while hard_memory not in hard_memory_options:
|
|
238
|
+
hard_memory = input("Memory Limit (leave empty for 1g): ")
|
|
239
|
+
if hard_memory == "":
|
|
240
|
+
hard_memory = "1g"
|
|
241
|
+
|
|
242
|
+
if hard_memory not in hard_memory_options:
|
|
243
|
+
print(f"Options are: {hard_memory_options}")
|
|
235
244
|
|
|
236
245
|
if grader_mvp == "y":
|
|
237
246
|
unit_test_filename = "unittests"
|
|
@@ -257,18 +266,18 @@ def load_templates() -> dict[str, str]:
|
|
|
257
266
|
TAG_ID=V$(GRADER_VERSION)
|
|
258
267
|
SUB_DIR=mount
|
|
259
268
|
MEMORY_LIMIT=4096
|
|
260
|
-
HARD_MEMORY={hard_memory}
|
|
261
269
|
CPUS={cpus}
|
|
262
270
|
SOFT_MEMORY={soft_memory}
|
|
271
|
+
HARD_MEMORY={hard_memory}
|
|
263
272
|
"""
|
|
264
273
|
|
|
265
|
-
|
|
274
|
+
assignment_name = f"C{course}M{module}_Assignment.ipynb"
|
|
266
275
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
276
|
+
copy_assignment_to_submission_sh = generate_copy_assignment_script(
|
|
277
|
+
extra_file_required=non_notebook_grading,
|
|
278
|
+
assignment_name=assignment_name,
|
|
279
|
+
extra_file_name=extra_file_name,
|
|
280
|
+
)
|
|
272
281
|
|
|
273
282
|
makefile = copy_makefile()
|
|
274
283
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
dlai_grader/__init__.py,sha256=
|
|
1
|
+
dlai_grader/__init__.py,sha256=kisxRYjpk8bk5dZK5AMHM69PqUB6bwdnig0LWjY9E0o,210
|
|
2
2
|
dlai_grader/cli.py,sha256=NIwboE-AFn1LXOFmF4O70Ow0fkRxgclG_eMwmWiua38,4917
|
|
3
3
|
dlai_grader/compiler.py,sha256=elbHNUCqBCoOOoNmMRXbgeNL0nt0RM57eZi0-6AqycA,3036
|
|
4
4
|
dlai_grader/config.py,sha256=DokK1tVF_r7v0p9tWpBN-7lOAlPmHSpFXDZiI8cGw7s,1821
|
|
5
5
|
dlai_grader/grading.py,sha256=BMIoZ_loQDuNCEk1Dj3on4IWz-FGgIbnhbDyk8HmQ7c,5041
|
|
6
6
|
dlai_grader/io.py,sha256=5hs7Bv5zfyHKZUrFP-2gVH7y9dbIFsyGiKgsqFYbrMs,9250
|
|
7
7
|
dlai_grader/notebook.py,sha256=MgxZFuetTXwwZ-HXSB5ItLVD_9LP45E0xHAngS0g4EU,12101
|
|
8
|
-
dlai_grader/templates.py,sha256=
|
|
8
|
+
dlai_grader/templates.py,sha256=OdmwnmNS2KCCcZ4-9jqfclV43tmbJoSuCk-5QWU6KoE,9291
|
|
9
9
|
dlai_grader/types.py,sha256=5uiFaF3aDn-vjxTp9ec-ND-PRqeeV2_NfPHS2ngGsRo,306
|
|
10
10
|
dlai_grader/templates/Makefile,sha256=PhRJ-87fU3IMqYMt9ChrAAfr2BPlk0uwogygLZItZL8,1795
|
|
11
11
|
dlai_grader/templates/grader.py,sha256=492Dzs3enoCGfDviq_mdnrzeF5e1qNl21i42M5tjv4Y,896
|
|
@@ -18,10 +18,10 @@ dlai_grader/templates/dockerfile/data_y_solution_y,sha256=xs6p-puJ-j5AeIuHiESL7X
|
|
|
18
18
|
dlai_grader/templates/entry_py/solution_n_file_n.py,sha256=Y9cuwGuCrRHWfWmcvNP-Gh8mFcJL_JE0e9Ed09O7x6Q,2349
|
|
19
19
|
dlai_grader/templates/entry_py/solution_n_file_y.py,sha256=yHXK4iRVaxlhAwq3FiOfFEJdSRApfOgs3FMQtIe-A_c,2984
|
|
20
20
|
dlai_grader/templates/entry_py/solution_y_file_n.py,sha256=MKVmgXJVC1UtxtChsah7jUQ6-SL93kafZ02KrSayN0k,2397
|
|
21
|
-
dlai_grader/templates/entry_py/solution_y_file_y.py,sha256=
|
|
22
|
-
dlai_grader-2.
|
|
23
|
-
dlai_grader-2.
|
|
24
|
-
dlai_grader-2.
|
|
25
|
-
dlai_grader-2.
|
|
26
|
-
dlai_grader-2.
|
|
27
|
-
dlai_grader-2.
|
|
21
|
+
dlai_grader/templates/entry_py/solution_y_file_y.py,sha256=7ioDw33vx0bRDw3yFlMX5DsjA2ZJxOL0g3s7ukQ36so,3054
|
|
22
|
+
dlai_grader-2.0b3.dist-info/licenses/LICENSE,sha256=a_kch_UqdJPtyxk35QJr9O84K_koPixqWPYW9On4-io,1072
|
|
23
|
+
dlai_grader-2.0b3.dist-info/METADATA,sha256=6Q4Ioa45aZ9Pof5bpa-pMm2av7gryZwnzf0Hcp94bdM,8776
|
|
24
|
+
dlai_grader-2.0b3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
25
|
+
dlai_grader-2.0b3.dist-info/entry_points.txt,sha256=4OcSAUIluONXa3ymViQ7CBQ2Lk52nb6xZnfph1rlMnk,71
|
|
26
|
+
dlai_grader-2.0b3.dist-info/top_level.txt,sha256=4YKtA3ztisFtx_g4hsGivy3J2NHnXxFziIMqawC8HWg,12
|
|
27
|
+
dlai_grader-2.0b3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|