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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ygrader
3
- Version: 1.1.25
3
+ Version: 1.1.27
4
4
  Summary: Grading scripts used in BYU's Electrical and Computer Engineering Department
5
5
  Home-page: https://github.com/byu-cpe/ygrader
6
6
  Author: Jeff Goeders
@@ -3,7 +3,7 @@ from setuptools import setup
3
3
  setup(
4
4
  name="ygrader",
5
5
  packages=["ygrader"],
6
- version="1.1.25",
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", grades_csv_path.name, "file empty?"
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[df[df.columns.intersection(expected_grade_col_names)].isnull().any(axis=1)]
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(df_needs_grade, github_csv_path, github_csv_col_name, use_https):
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", github_csv_path.name, "file empty?"
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 URL
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
- if len(missing_df.index):
67
- warning(len(missing_df.index), "student(s) Net ID are missing a github URL:")
68
- for _, row in missing_df.iterrows():
69
- print_color(TermColors.YELLOW, row["Net ID"])
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("Your group CSV", "(" + str(groups_csv_path) + ")", "is missing a 'Net ID' column.")
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ygrader
3
- Version: 1.1.25
3
+ Version: 1.1.27
4
4
  Summary: Grading scripts used in BYU's Electrical and Computer Engineering Department
5
5
  Home-page: https://github.com/byu-cpe/ygrader
6
6
  Author: Jeff Goeders
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes