ygrader 1.1.25__tar.gz → 1.1.27__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.
- {ygrader-1.1.25/ygrader.egg-info → ygrader-1.1.27}/PKG-INFO +1 -1
- {ygrader-1.1.25 → ygrader-1.1.27}/setup.py +1 -1
- {ygrader-1.1.25 → ygrader-1.1.27}/ygrader/grades_csv.py +33 -10
- {ygrader-1.1.25 → ygrader-1.1.27/ygrader.egg-info}/PKG-INFO +1 -1
- {ygrader-1.1.25 → ygrader-1.1.27}/LICENSE +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/setup.cfg +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/test/test_interactive.py +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/test/test_unittest.py +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/ygrader/__init__.py +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/ygrader/grader.py +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/ygrader/grading_item.py +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/ygrader/student_repos.py +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/ygrader/upstream_merger.py +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/ygrader/utils.py +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/ygrader.egg-info/SOURCES.txt +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/ygrader.egg-info/dependency_links.txt +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/ygrader.egg-info/requires.txt +0 -0
- {ygrader-1.1.25 → ygrader-1.1.27}/ygrader.egg-info/top_level.txt +0 -0
|
@@ -3,7 +3,7 @@ from setuptools import setup
|
|
|
3
3
|
setup(
|
|
4
4
|
name="ygrader",
|
|
5
5
|
packages=["ygrader"],
|
|
6
|
-
version="1.1.
|
|
6
|
+
version="1.1.27",
|
|
7
7
|
description="Grading scripts used in BYU's Electrical and Computer Engineering Department",
|
|
8
8
|
author="Jeff Goeders",
|
|
9
9
|
author_email="jeff.goeders@gmail.com",
|
|
@@ -12,7 +12,9 @@ def parse_and_check(grades_csv_path, csv_cols):
|
|
|
12
12
|
grades_df = pandas.read_csv(grades_csv_path)
|
|
13
13
|
except pandas.errors.EmptyDataError:
|
|
14
14
|
error(
|
|
15
|
-
"Exception: pandas.errors.EmptyDataError. Is your",
|
|
15
|
+
"Exception: pandas.errors.EmptyDataError. Is your",
|
|
16
|
+
grades_csv_path.name,
|
|
17
|
+
"file empty?",
|
|
16
18
|
)
|
|
17
19
|
check_csv_column_names(grades_df, csv_cols)
|
|
18
20
|
return grades_df
|
|
@@ -36,17 +38,23 @@ def check_csv_column_names(df, expected_grade_col_names):
|
|
|
36
38
|
|
|
37
39
|
def filter_need_grade(df, expected_grade_col_names):
|
|
38
40
|
"""Filter down to only those students that need a grade"""
|
|
39
|
-
filtered_df = df[
|
|
41
|
+
filtered_df = df[
|
|
42
|
+
df[df.columns.intersection(expected_grade_col_names)].isnull().any(axis=1)
|
|
43
|
+
]
|
|
40
44
|
return filtered_df
|
|
41
45
|
|
|
42
46
|
|
|
43
|
-
def match_to_github_url(
|
|
47
|
+
def match_to_github_url(
|
|
48
|
+
df_needs_grade, github_csv_path, github_csv_col_name, use_https
|
|
49
|
+
):
|
|
44
50
|
"""Match students to their github URL"""
|
|
45
51
|
try:
|
|
46
52
|
df_github = pandas.read_csv(github_csv_path, index_col=False)
|
|
47
53
|
except pandas.errors.EmptyDataError:
|
|
48
54
|
error(
|
|
49
|
-
"Exception pandas.errors.EmptyDataError. Is your",
|
|
55
|
+
"Exception pandas.errors.EmptyDataError. Is your",
|
|
56
|
+
github_csv_path.name,
|
|
57
|
+
"file empty?",
|
|
50
58
|
)
|
|
51
59
|
|
|
52
60
|
# Strip whitespace from CSV header names
|
|
@@ -61,12 +69,23 @@ def match_to_github_url(df_needs_grade, github_csv_path, github_csv_col_name, us
|
|
|
61
69
|
# Rename appropriate column to github url
|
|
62
70
|
df_github.rename(columns={github_csv_col_name: "github_url"}, inplace=True)
|
|
63
71
|
|
|
64
|
-
# Missing github
|
|
72
|
+
# Missing from github CSV - Find Net IDs in df_needs_grade that are not in df_github
|
|
73
|
+
missing_netids = df_needs_grade[~df_needs_grade["Net ID"].isin(df_github["Net ID"])]
|
|
74
|
+
|
|
75
|
+
# Empty github URL
|
|
65
76
|
missing_df = df_github[df_github.isnull().any(axis=1)]
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
77
|
+
|
|
78
|
+
if len(missing_netids) or len(missing_df.index):
|
|
79
|
+
warning(
|
|
80
|
+
len(missing_netids.index) + len(missing_df.index),
|
|
81
|
+
"student(s) Net ID are missing a github URL:",
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
for _, row in missing_netids.iterrows():
|
|
85
|
+
print_color(" ", TermColors.YELLOW, row["Net ID"])
|
|
86
|
+
for _, row in missing_df.iterrows():
|
|
87
|
+
print_color(" ", TermColors.YELLOW, row["Net ID"])
|
|
88
|
+
|
|
70
89
|
df_github = df_github.dropna()
|
|
71
90
|
|
|
72
91
|
# Convert github URLs to https or SSH
|
|
@@ -100,7 +119,11 @@ def add_group_column_from_csv(df, column_name, groups_csv_path, groups_csv_col_n
|
|
|
100
119
|
|
|
101
120
|
# Filter down to relevant columns
|
|
102
121
|
if "Net ID" not in df_groups.columns:
|
|
103
|
-
error(
|
|
122
|
+
error(
|
|
123
|
+
"Your group CSV",
|
|
124
|
+
"(" + str(groups_csv_path) + ")",
|
|
125
|
+
"is missing a 'Net ID' column.",
|
|
126
|
+
)
|
|
104
127
|
df_groups = df_groups[["Net ID", column_name]]
|
|
105
128
|
|
|
106
129
|
# Merge with student dataframe (inner merge will drop students not in group CSV)
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|