Skip to content

Commit

Permalink
[Testing:Developer] Fix Python linting errors (Submitty#8242)
Browse files Browse the repository at this point in the history
* Fix errors

* Append strings instead of using multiline comment
  • Loading branch information
williamjallen authored Aug 1, 2022
1 parent 49d4418 commit 4afeed7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/grading_done.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def __init__(self, json_file, epoch_time, is_grading):
# the 'GRADING_' file.
if is_grading:
base, tail = os.path.split(json_file)
assert(tail.startswith('GRADING_'))
assert tail.startswith('GRADING_')

with open(json_file, 'r') as infile:
self.grading_queue_obj = json.load(infile)
Expand Down
4 changes: 2 additions & 2 deletions bin/set_allowed_mins.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def send_data(db, allowed_minutes, override):
db.execute(text(query), gradeable=GRADEABLE)
if override is not None:
for user in override:
query = """INSERT INTO gradeable_allowed_minutes_override (g_id, user_id, allowed_minutes)
VALUES (:gradeable, :userid, :minutes)"""
query = "INSERT INTO gradeable_allowed_minutes_override (g_id, user_id, allowed_minutes) " +\
"VALUES (:gradeable, :userid, :minutes)" # noqa: E501
db.execute(text(query), gradeable=GRADEABLE, userid=user['user'],
minutes=user['allowed_minutes'])

Expand Down
4 changes: 2 additions & 2 deletions sbin/submitty_daemon_jobs/submitty_jobs/submitty_ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def preprocess(img):
contours, _ = cv2.findContours(img_final_bin, cv2.RETR_TREE,
cv2.CHAIN_APPROX_SIMPLE)

if(len(contours) == 0):
if len(contours) == 0:
return []

contours, boundingBoxes = sort_contours(contours)
Expand All @@ -82,7 +82,7 @@ def preprocess(img):
# get the individual images
for c in contours:
x, y, w, h = cv2.boundingRect(c)
if(w > 20 and w < 75 and h > 35 and h < 125):
if w > 20 and w < 75 and h > 35 and h < 125:
idx += 1
new_img = img[y:y+h, x:x+w]
# convert to MNIST expected img
Expand Down

0 comments on commit 4afeed7

Please sign in to comment.