Skip to content

Commit 752ff7f

Browse files
committed
Merge branch 'master' of github.com:object-oriented-python/object-oriented-programming into master
2 parents d526e01 + 03114f2 commit 752ff7f

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

doc/source/5_abstract_data_types.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ documented in the :ref:`official Python documentation <typeiter>`.
643643
.. hint::
644644

645645
Raising exceptions is the subject of :numref:`raising_exceptions`,
646-
to which we will turn presently. Fur current purposes, it is
646+
to which we will turn presently. For current purposes, it is
647647
sufficient to know that iteration is halted when :meth:`~iterator.__next__`
648648
executes this line of code:
649649

doc/webgit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit dd7dd29d5161b6b5ff640c4fa7b2a3aa958da10f
1+
Subproject commit a5f01539f65d6b78d59ead0fa1844d92bae88976

scripts/oo_exercise_marks

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#! /usr/bin/env python3
2+
import pandas
3+
from argparse import ArgumentParser
4+
import sys
5+
6+
parser = ArgumentParser(
7+
description="""Import GitHub Classroom autotest"""
8+
""" results into Blackboard.""")
9+
parser.add_argument(
10+
"github", type=str, action="store",
11+
help="The CSV Grade file downloaded from GitHub Classroom."
12+
)
13+
parser.add_argument(
14+
"blackboard", type=str, action="store",
15+
help="The CSV Grade file downloaded from Blackboard."
16+
)
17+
parser.add_argument("--week", type=int, action="store",
18+
help="The week whose exercises we are marking.")
19+
parser.add_argument("--max-mark", type=int, action="store",
20+
help="The maximum mark achievable.")
21+
22+
args = parser.parse_args()
23+
24+
blackboard = pandas.read_csv(args.blackboard)
25+
26+
try:
27+
mark_column = [k for k in blackboard.keys()
28+
if k.startswith(f"Week {args.week}")][0]
29+
except IndexError:
30+
sys.stderr.write(f'{args.blackboard} has no Week {args.week} column')
31+
32+
github = pandas.read_csv(args.github)
33+
34+
grade_map = {username: grade//args.max_mark or float("NaN") for username, grade
35+
in zip(github["roster_identifier"], github["points_awarded"])}
36+
37+
grades = [grade_map.get(username, float("NaN"))
38+
for username in blackboard["Username"]]
39+
40+
blackboard[mark_column].update(grades)
41+
42+
blackboard.to_csv(f"marks_week_{args.week}.csv", index=False)

0 commit comments

Comments
 (0)