Please leave this code that immediately precedes STUDENT 2 in Assignment 3's generator as I handed it out:
# ORIGINAL
HANDOUT CODE:
# seedless shuffle of data rows checks
student sorting later on.
InputData[0][1] = shuffle(InputData[0][1])
InputData[1][1] = shuffle(InputData[0][1])
# LEAVE THIS AS HANDED OUT
tracefile = open(tracefilename, 'w',
newline='')
Therefore, after the last step of STUDENT 2:
# 1e. Call writeCSVfile where the filename is arglist[0] with the
# string 'CLEANED.' prepended onto the front of
arglist[0] and WITH
# POSSIBLE EXTENSION '.gz' removed if there is one,
and
# the other two arguments to writeCSVfile are
InputData[0][0] and
# InputData[0][1]. Do another call to writeCSVfile
with the same
# 'CLEANED.' prefix using arglist[1] (without any
'.gz' -- write
# an uncompressed .csv file), InputData[1][0], and
InputData[1][1].
You can insert these lines of code:
trainOK = os.system('PYTHONPATH=.
/usr/bin/python3.11 ./diffcsvWgz.py
CLEANED.fall2024concert_train.csv
CLEANED.fall2024concert_train.ref.csv')
testOK = os.system('PYTHONPATH=. /usr/bin/python3.11
./diffcsvWgz.py CLEANED.fall2024concert_test.csv
CLEANED.fall2024concert_test.ref.csv')
if trainOK != 0:
sys.stderr.write('PROBLEM WITH
CLEANED.fall2024concert_train.csv')
if testOK != 0:
sys.stderr.write('PROBLEM WITH
CLEANED.fall2024concert_test.csv')
if trainOK or testOK:
sys.exit(trainOK | testOK)
If those test fail, watch for output like this:
PYTHONPATH=. /usr/bin/python3.11 diffcsvWgz.py
CLEANED.fall2024concert_test.csv
CLEANED.fall2024concert_test.ref.csv
Mismatch at attribute notenum <
60.0 > 79.0 LINE 1
Mismatch at attribute notenum <
62.0 > 74.0 LINE 3
Mismatch at attribute notenum <
71.0 > 62.0 LINE 4
Mismatch at attribute notenum <
71.0 > 79.0 LINE 7
Mismatch at attribute notenum <
67.0 > 79.0 LINE 8
where '<' is your output and '>' is the reference file.