From 2ffef489f827182e3d979c4aaa0956d3ee79c6a7 Mon Sep 17 00:00:00 2001 From: Scott Numamoto Date: Thu, 19 Mar 2020 23:57:23 -0700 Subject: [PATCH 1/9] Ignore vscode --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 23038f9..50609c3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ __pycache__/ mentors.csv teams.csv matching.csv -compatibility.csv \ No newline at end of file +compatibility.csv +.vscode/ From e2bac1a8005106554867f2f2d6a99429460af295 Mon Sep 17 00:00:00 2001 From: Scott Numamoto Date: Fri, 20 Mar 2020 23:59:20 -0700 Subject: [PATCH 2/9] Reorganize --- mentors-example.csv => data/mentors-example.csv | 0 teams-example.csv => data/teams-example.csv | 0 assign.py => mentor_matching/assign.py | 0 utils.py => mentor_matching/utils.py | 0 tests/mentor_test.py | 12 ++++++++++++ 5 files changed, 12 insertions(+) rename mentors-example.csv => data/mentors-example.csv (100%) rename teams-example.csv => data/teams-example.csv (100%) rename assign.py => mentor_matching/assign.py (100%) rename utils.py => mentor_matching/utils.py (100%) create mode 100644 tests/mentor_test.py diff --git a/mentors-example.csv b/data/mentors-example.csv similarity index 100% rename from mentors-example.csv rename to data/mentors-example.csv diff --git a/teams-example.csv b/data/teams-example.csv similarity index 100% rename from teams-example.csv rename to data/teams-example.csv diff --git a/assign.py b/mentor_matching/assign.py similarity index 100% rename from assign.py rename to mentor_matching/assign.py diff --git a/utils.py b/mentor_matching/utils.py similarity index 100% rename from utils.py rename to mentor_matching/utils.py diff --git a/tests/mentor_test.py b/tests/mentor_test.py new file mode 100644 index 0000000..40848b6 --- /dev/null +++ b/tests/mentor_test.py @@ -0,0 +1,12 @@ +import unittest +from utils import Mentor + +class TestParsingMentor(unittest.TestCase): + def test_from_string(self): + raw_csv_line = "Mavericl,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,,,Jessica,1,Inconvenient,Convenient,Convenient,Not possible,Not possible,Somewhat,Very Confident" + mentor = Mentor(raw_csv_line) + + self.assertEqual(mentor.name, "Mavericl") + +if __name__ == "__main__": + unittest.main() From 4bae72cb380c1da75d5307f7d921fc6481f0c140 Mon Sep 17 00:00:00 2001 From: Scott Numamoto Date: Sat, 21 Mar 2020 15:51:10 -0700 Subject: [PATCH 3/9] Reflect new data location --- mentor_matching/assign.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mentor_matching/assign.py b/mentor_matching/assign.py index 8422d32..0ee231e 100644 --- a/mentor_matching/assign.py +++ b/mentor_matching/assign.py @@ -12,7 +12,7 @@ print("Process started! Reading mentor file...", flush = True) mentors = [] -with open("mentors.csv") as mentorFile: +with open("data/mentors.csv") as mentorFile: mentorReader = csv.reader(mentorFile) # remove header rows, if any for _ in range(utils.mentorHeaderRows): @@ -22,7 +22,7 @@ print("Reading team file...", flush = True) teams = [] -with open("teams.csv") as teamFile: +with open("data/teams.csv") as teamFile: teamReader = csv.reader(teamFile) # remove header rows, if any for _ in range(utils.teamHeaderRows): From 929f9c7ae330b54b80171b497a34b1b19e1e5876 Mon Sep 17 00:00:00 2001 From: Scott Numamoto Date: Sat, 21 Mar 2020 15:53:13 -0700 Subject: [PATCH 4/9] Form module --- mentor_matching/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 mentor_matching/__init__.py diff --git a/mentor_matching/__init__.py b/mentor_matching/__init__.py new file mode 100644 index 0000000..e69de29 From 90ccf555d6d2154f2fd3d73eb5c5dbc4c9bfbf75 Mon Sep 17 00:00:00 2001 From: Scott Numamoto Date: Sat, 21 Mar 2020 16:06:37 -0700 Subject: [PATCH 5/9] Create basic mentor test --- .gitignore | 1 + mentor_matching/mentor_test.py | 19 +++++++++++++++++++ tests/mentor_test.py | 12 ------------ 3 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 mentor_matching/mentor_test.py delete mode 100644 tests/mentor_test.py diff --git a/.gitignore b/.gitignore index 50609c3..55a0ddd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ teams.csv matching.csv compatibility.csv .vscode/ +*.pyc diff --git a/mentor_matching/mentor_test.py b/mentor_matching/mentor_test.py new file mode 100644 index 0000000..087dd94 --- /dev/null +++ b/mentor_matching/mentor_test.py @@ -0,0 +1,19 @@ +import unittest +from utils import Mentor +import csv + + +class TestParsingMentor(unittest.TestCase): + def test_from_string(self): + raw_csv_line = [ + "Mavericl,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,,,Jessica,1,Inconvenient,Convenient,Convenient,Not possible,Not possible,Somewhat,Very Confident" + ] + reader = csv.reader(raw_csv_line) + processed_line = next(reader) + mentor = Mentor(processed_line) + + self.assertEqual(mentor.name, "Mavericl") + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/mentor_test.py b/tests/mentor_test.py deleted file mode 100644 index 40848b6..0000000 --- a/tests/mentor_test.py +++ /dev/null @@ -1,12 +0,0 @@ -import unittest -from utils import Mentor - -class TestParsingMentor(unittest.TestCase): - def test_from_string(self): - raw_csv_line = "Mavericl,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,,,Jessica,1,Inconvenient,Convenient,Convenient,Not possible,Not possible,Somewhat,Very Confident" - mentor = Mentor(raw_csv_line) - - self.assertEqual(mentor.name, "Mavericl") - -if __name__ == "__main__": - unittest.main() From a9014db8eed96686e433be776017675ff6829b63 Mon Sep 17 00:00:00 2001 From: Scott Numamoto Date: Sat, 21 Mar 2020 16:51:44 -0700 Subject: [PATCH 6/9] Test on all fields --- mentor_matching/mentor_test.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/mentor_matching/mentor_test.py b/mentor_matching/mentor_test.py index 087dd94..14da28f 100644 --- a/mentor_matching/mentor_test.py +++ b/mentor_matching/mentor_test.py @@ -1,6 +1,7 @@ +import csv import unittest + from utils import Mentor -import csv class TestParsingMentor(unittest.TestCase): @@ -13,6 +14,22 @@ def test_from_string(self): mentor = Mentor(processed_line) self.assertEqual(mentor.name, "Mavericl") + self.assertEqual(mentor.teamTypeRequests, [1, 1, 0, 0]) + self.assertEqual(mentor.teamsRequested, []) + self.assertEqual(mentor.teamsRequired, []) + self.assertEqual(mentor.mentorsRequired, ["Jessica"]) + self.assertEqual(mentor.comfortAlone, "1") + self.assertEqual( + mentor.transitConveniences, + [ + "Inconvenient", + "Convenient", + "Convenient", + "Not possible", + "Not possible", + ], + ) + self.assertEqual(mentor.skillsConfidence, ["Somewhat", "Very Confident"]) if __name__ == "__main__": From e2d44762af14cbd0b7402e0556947714bb551fd8 Mon Sep 17 00:00:00 2001 From: Scott Numamoto Date: Sat, 21 Mar 2020 22:45:36 -0700 Subject: [PATCH 7/9] - Run formatting on assign.py --- main.py | 195 ++++++++++++++++++++++++++++++++++++++ mentor_matching/assign.py | 160 ------------------------------- 2 files changed, 195 insertions(+), 160 deletions(-) create mode 100644 main.py delete mode 100644 mentor_matching/assign.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..8e50af2 --- /dev/null +++ b/main.py @@ -0,0 +1,195 @@ +""" +Main script for running mentor matching +""" +import csv +import time # for testing purposes + +import cvxpy as cp +import utils +from utils import Mentor +from utils import Team + + +print("Process started! Reading mentor file...", flush=True) +mentors = [] +with open("data/mentors-example.csv") as mentorFile: + mentorReader = csv.reader(mentorFile) + # remove header rows, if any + for _ in range(utils.mentorHeaderRows): + next(mentorReader) # just read the row and throw it away + for dataRow in mentorReader: + mentors.append( + Mentor(dataRow) + ) # create a new mentor object based on each row of data + +print("Reading team file...", flush=True) +teams = [] +with open("data/teams-example.csv") as teamFile: + teamReader = csv.reader(teamFile) + # remove header rows, if any + for _ in range(utils.teamHeaderRows): + next(teamReader) # throw out header rows + for dataRow in teamReader: + teams.append(Team(dataRow)) # create the team object + +print("Creating compatibility file...", flush=True) +with open("compatibility.csv", "w", newline="") as compatFile: + compatWriter = csv.writer(compatFile) + firstRow = ["Name"] # first row is a header that gives the name of each team + for team in teams: + firstRow.append(team.name) + compatWriter.writerow(firstRow) + for mentor in mentors: + mentorRow = [ + mentor.name + ] # contains the name of this mentor + compatibility for each team + for team in teams: + mentorRow.append(str(utils.getTeamCompatibility(mentor, team))) + compatWriter.writerow(mentorRow) +print("Compatibilities output to compatibility.csv") + +print("Creating optimization variables...", flush=True) +variables = [] # list of all variables +varByType = {} # map from variable type to list of variables of that type +varByMentor = ( + {} +) # map from (variable type, mentor) to list of variables of that type for that mentor +varByTeam = ( + {} +) # map from (variable type, team) to list of variables of that type for that team +varByPair = ( + {} +) # map from (variable type, mentor, team) to list of variable of that type for that team and mentor +groupByVar = ( + {} +) # map from a variable to the (variable type, mentor, team) corresponding to it +# initialize varByType, varByMentor, varByTeam, and varByPair with empty lists to prevent KeyErrors later +for varType in [1, 2]: + varByType[varType] = [] + for mentor in mentors: + varByMentor[(varType, mentor)] = [] + for team in teams: + varByPair[(varType, mentor, team)] = [] + for team in teams: + varByTeam[(varType, team)] = [] +# create variables +for varType in [1, 2]: + for mentor in mentors: + for team in teams: + newVar = cp.Variable(boolean=True) + variables.append(newVar) + varByType[varType].append(newVar) + varByMentor[(varType, mentor)].append(newVar) + varByTeam[(varType, team)].append(newVar) + varByPair[(varType, mentor, team)].append(newVar) + groupByVar[newVar] = (varType, mentor, team) + +print("Creating constraints...", flush=True) +constraints = [] +# create type (1) constraints +for team in teams: + typeOneVars = varByTeam[(1, team)] + typeTwoVars = varByTeam[(2, team)] + constraints.append(sum(typeTwoVars) + (2 * sum(typeOneVars)) >= 2) +# create type (2) constraints +for mentor in mentors: + typeOneVars = varByMentor[(1, mentor)] + typeTwoVars = varByMentor[(2, mentor)] + constraints.append(sum(typeOneVars) + sum(typeTwoVars) == 1) +# create type (3) constraints +for team in teams: + typeOneVars = varByTeam[(1, team)] + typeTwoVars = varByTeam[(2, team)] + constraints.append(sum(typeOneVars) + sum(typeTwoVars) >= utils.minNumMentors) + constraints.append(sum(typeOneVars) + sum(typeTwoVars) <= utils.maxNumMentors) +# create type (4) and (5) constraints +for mentor1 in mentors: + for mentor2 in mentors: + if mentors.index(mentor1) >= mentors.index(mentor2): + # we only want to consider each pair once, so ignore the second occurrence + # this also ensures that we don't consider pairing a mentor with themself + continue + if mentor1.mustPair(mentor2) or mentor2.mustPair(mentor1): + # these mentors are required to be paired, so create the constraints for them + constraints.append( + sum(varByMentor[(1, mentor1)]) + sum(varByMentor[(1, mentor2)]) == 0 + ) # type (4) constraint + for team in teams: + mentor1Var = varByPair[(2, mentor1, team)][ + 0 + ] # get type (2) variables for these mentors and this team + mentor2Var = varByPair[(2, mentor2, team)][ + 0 + ] # there will only be one variable in each list, so extract it + constraints.append(mentor1Var - mentor2Var >= 0) # type (5) constraint + +print("Creating objective function...", flush=True) +objectiveTerms = ( + [] +) # list of terms that will be added together to make the objective function +# create type (1) terms +for var1 in varByType[1]: + _, varMentor, varTeam = groupByVar[ + var1 + ] # figure out which mentor and team this variable is for + value = utils.getTeamCompatibility(varMentor, varTeam) - utils.getMentorAloneCost( + varMentor + ) + objectiveTerms.append(value * var1) +# create type (2) terms +for var2 in varByType[2]: + _, varMentor, varTeam = groupByVar[ + var2 + ] # figure out which mentor and team this variable is for + value = utils.getTeamCompatibility(varMentor, varTeam) + objectiveTerms.append(value * var2) +objective = sum(objectiveTerms) + +print("Creating problem...", flush=True) +prob = cp.Problem(cp.Maximize(objective), constraints) + +print("Solving problem...", flush=True) +startTime = time.time() +prob.solve() +endTime = time.time() + +if prob.value is None: + print("Something went wrong in the problem solving???") + print("Problem status:", prob.status) + print("Time elapsed:", endTime - startTime) +else: + print( + "Problem solved! Time elapsed: " + + str(endTime - startTime) + + "\nFinal objective value of " + + str(prob.value) + ) + teamByMentor = {} # mapping from a mentor to the team they are assigned to + mentorsByTeam = {} # mapping from a team to a list of mentors assigned to that team + for team in teams: + mentorsByTeam[ + team + ] = [] # initialize all of these to empty lists so we can use append freely + for variable in variables: + if variable.value > 0.5: + _, varMentor, varTeam = groupByVar[variable] + teamByMentor[varMentor] = varTeam + mentorsByTeam[varTeam].append(varMentor) + with open("matching.csv", "w", newline="") as matchFile: + matchWriter = csv.writer(matchFile) + matchWriter.writerow(["Mentor Name", "Team Name", "Other Mentor(s)"]) + for mentor in mentors: + team = teamByMentor[mentor] + otherMentors = mentorsByTeam[team][ + : + ] # make sure this is a copy and not a pointer to the original + otherMentors.remove(mentor) # otherwise this line will cause problems + otherMentorsString = "" # will contain all the other mentors assigned to this team, separated by semicolons + if len(otherMentors) == 0: + otherMentorsString = "N/A" + else: + otherMentorsString = otherMentors[0].name + for omIndex in range(1, len(otherMentors)): + otherMentorsString += "; " + otherMentors[omIndex].name + matchWriter.writerow([mentor.name, team.name, otherMentorsString]) + print("Matching output to matching.csv") diff --git a/mentor_matching/assign.py b/mentor_matching/assign.py deleted file mode 100644 index 0ee231e..0000000 --- a/mentor_matching/assign.py +++ /dev/null @@ -1,160 +0,0 @@ -""" -Main script for running mentor matching -""" - -import cvxpy as cp -import utils -from utils import Mentor, Team -import csv - -import time # for testing purposes - - -print("Process started! Reading mentor file...", flush = True) -mentors = [] -with open("data/mentors.csv") as mentorFile: - mentorReader = csv.reader(mentorFile) - # remove header rows, if any - for _ in range(utils.mentorHeaderRows): - next(mentorReader) # just read the row and throw it away - for dataRow in mentorReader: - mentors.append(Mentor(dataRow)) # create a new mentor object based on each row of data - -print("Reading team file...", flush = True) -teams = [] -with open("data/teams.csv") as teamFile: - teamReader = csv.reader(teamFile) - # remove header rows, if any - for _ in range(utils.teamHeaderRows): - next(teamReader) # throw out header rows - for dataRow in teamReader: - teams.append(Team(dataRow)) # create the team object - -print("Creating compatibility file...", flush = True) -with open('compatibility.csv', 'w', newline = '') as compatFile: - compatWriter = csv.writer(compatFile) - firstRow = ['Name'] # first row is a header that gives the name of each team - for team in teams: - firstRow.append(team.name) - compatWriter.writerow(firstRow) - for mentor in mentors: - mentorRow = [mentor.name] # contains the name of this mentor + compatibility for each team - for team in teams: - mentorRow.append(str(utils.getTeamCompatibility(mentor, team))) - compatWriter.writerow(mentorRow) -print("Compatibilities output to compatibility.csv") - -print("Creating optimization variables...", flush = True) -variables = [] # list of all variables -varByType = {} # map from variable type to list of variables of that type -varByMentor = {} # map from (variable type, mentor) to list of variables of that type for that mentor -varByTeam = {} # map from (variable type, team) to list of variables of that type for that team -varByPair = {} # map from (variable type, mentor, team) to list of variable of that type for that team and mentor -groupByVar = {} # map from a variable to the (variable type, mentor, team) corresponding to it -# initialize varByType, varByMentor, varByTeam, and varByPair with empty lists to prevent KeyErrors later -for varType in [1, 2]: - varByType[varType] = [] - for mentor in mentors: - varByMentor[(varType, mentor)] = [] - for team in teams: - varByPair[(varType, mentor, team)] = [] - for team in teams: - varByTeam[(varType, team)] = [] -# create variables -for varType in [1, 2]: - for mentor in mentors: - for team in teams: - newVar = cp.Variable(boolean = True) - variables.append(newVar) - varByType[varType].append(newVar) - varByMentor[(varType, mentor)].append(newVar) - varByTeam[(varType, team)].append(newVar) - varByPair[(varType, mentor, team)].append(newVar) - groupByVar[newVar] = (varType, mentor, team) - -print("Creating constraints...", flush = True) -constraints = [] -# create type (1) constraints -for team in teams: - typeOneVars = varByTeam[(1, team)] - typeTwoVars = varByTeam[(2, team)] - constraints.append(sum(typeTwoVars) + (2 * sum(typeOneVars)) >= 2) -# create type (2) constraints -for mentor in mentors: - typeOneVars = varByMentor[(1, mentor)] - typeTwoVars = varByMentor[(2, mentor)] - constraints.append(sum(typeOneVars) + sum(typeTwoVars) == 1) -# create type (3) constraints -for team in teams: - typeOneVars = varByTeam[(1, team)] - typeTwoVars = varByTeam[(2, team)] - constraints.append(sum(typeOneVars) + sum(typeTwoVars) >= utils.minNumMentors) - constraints.append(sum(typeOneVars) + sum(typeTwoVars) <= utils.maxNumMentors) -# create type (4) and (5) constraints -for mentor1 in mentors: - for mentor2 in mentors: - if mentors.index(mentor1) >= mentors.index(mentor2): - # we only want to consider each pair once, so ignore the second occurrence - # this also ensures that we don't consider pairing a mentor with themself - continue - if mentor1.mustPair(mentor2) or mentor2.mustPair(mentor1): - # these mentors are required to be paired, so create the constraints for them - constraints.append(sum(varByMentor[(1, mentor1)]) + sum(varByMentor[(1, mentor2)]) == 0) # type (4) constraint - for team in teams: - mentor1Var = varByPair[(2, mentor1, team)][0] # get type (2) variables for these mentors and this team - mentor2Var = varByPair[(2, mentor2, team)][0] # there will only be one variable in each list, so extract it - constraints.append(mentor1Var - mentor2Var >= 0) # type (5) constraint - -print("Creating objective function...", flush = True) -objectiveTerms = [] # list of terms that will be added together to make the objective function -# create type (1) terms -for var1 in varByType[1]: - _, varMentor, varTeam = groupByVar[var1] # figure out which mentor and team this variable is for - value = utils.getTeamCompatibility(varMentor, varTeam) - utils.getMentorAloneCost(varMentor) - objectiveTerms.append(value * var1) -# create type (2) terms -for var2 in varByType[2]: - _, varMentor, varTeam = groupByVar[var2] # figure out which mentor and team this variable is for - value = utils.getTeamCompatibility(varMentor, varTeam) - objectiveTerms.append(value * var2) -objective = sum(objectiveTerms) - -print("Creating problem...", flush = True) -prob = cp.Problem(cp.Maximize(objective), constraints) - -print("Solving problem...", flush = True) -startTime = time.time() -prob.solve() -endTime = time.time() - -if prob.value is None: - print("Something went wrong in the problem solving???") - print("Problem status:", prob.status) - print("Time elapsed:", endTime - startTime) -else: - print("Problem solved! Time elapsed: " + str(endTime - startTime) + "\nFinal objective value of " + str(prob.value)) - teamByMentor = {} # mapping from a mentor to the team they are assigned to - mentorsByTeam = {} # mapping from a team to a list of mentors assigned to that team - for team in teams: - mentorsByTeam[team] = [] # initialize all of these to empty lists so we can use append freely - for variable in variables: - if variable.value > 0.5: - _, varMentor, varTeam = groupByVar[variable] - teamByMentor[varMentor] = varTeam - mentorsByTeam[varTeam].append(varMentor) - with open('matching.csv', 'w', newline = '') as matchFile: - matchWriter = csv.writer(matchFile) - matchWriter.writerow(['Mentor Name', 'Team Name', 'Other Mentor(s)']) - for mentor in mentors: - team = teamByMentor[mentor] - otherMentors = mentorsByTeam[team][:] # make sure this is a copy and not a pointer to the original - otherMentors.remove(mentor) # otherwise this line will cause problems - otherMentorsString = "" # will contain all the other mentors assigned to this team, separated by semicolons - if len(otherMentors) == 0: - otherMentorsString = "N/A" - else: - otherMentorsString = otherMentors[0].name - for omIndex in range(1, len(otherMentors)): - otherMentorsString += "; " + otherMentors[omIndex].name - matchWriter.writerow([mentor.name, team.name, otherMentorsString]) - print("Matching output to matching.csv") From 71d783335ba62f2e3453ff83a23ba9548477e682 Mon Sep 17 00:00:00 2001 From: Scott Numamoto Date: Sat, 21 Mar 2020 22:48:50 -0700 Subject: [PATCH 8/9] Fix main import --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 8e50af2..7baa9c9 100644 --- a/main.py +++ b/main.py @@ -5,10 +5,11 @@ import time # for testing purposes import cvxpy as cp -import utils from utils import Mentor from utils import Team +from mentor_matching import utils + print("Process started! Reading mentor file...", flush=True) mentors = [] From ed80290ebeeee4ef95e51f265de198ff59737314 Mon Sep 17 00:00:00 2001 From: Scott Numamoto Date: Sat, 21 Mar 2020 22:49:48 -0700 Subject: [PATCH 9/9] Fix imports --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 7baa9c9..0a29644 100644 --- a/main.py +++ b/main.py @@ -5,10 +5,10 @@ import time # for testing purposes import cvxpy as cp -from utils import Mentor -from utils import Team from mentor_matching import utils +from mentor_matching.utils import Mentor +from mentor_matching.utils import Team print("Process started! Reading mentor file...", flush=True)