partnermatcher

This is an app that is used to calculate the optimal pairings for students looking for project partners, based on their response to several partner-matching questions.

Setup

To use the partner matching script, first create a form for students to fill out with the following columns:

  • Email Address

  • What is 8am PT (Berkeley Time) in your time?

  • How skillful a programmer do you consider yourself to be at this time?

  • Are you taking CS 61A for a letter grade?

  • What are three words that describe your interests?

Create a venv and install Python dependencies:

$ python3 -m venv env
$ env/bin/pip install -r requirements.txt

Running the Script

Once the deadline to fill out the form has passed, export the results to partnermatcher/data.csv. Then, update the spreadsheet location information on lines 96 and 97. Make sure these sheets are shared with secure-links@ok-server.iam.gserviceaccount.com.

To run the matching script and upload output to Google Sheets, run env/bin/python main.py.

Script Documentation

This file performs the partner matching algorithm. get_words() and get_weight are helper functions; match() is the main function which runs the algorithm.

partnermatcher.main.get_words(row)[source]

Returns a list of stripped, lower case words from the WORDS_COL column of a student response row.

Parameters

row (Series) – One-dimensional array containing a student’s responses to the partner matching questions.

Returns

a list of stripped, lower case words from the WORDS_COL column of a student response row.

partnermatcher.main.get_weight(row1, row2)[source]

Calculates and returns the partner matching weight between two students based on their responses. The higher the weight, the more the partner matching algorithm will favor matching these two students together.

Parameters
  • row1 (Series) – One-dimensional array containing the first student’s responses to the partner matching questions.

  • row2 (Series) – One-dimensional array containing the second student’s responses to the partner matching questions.

Returns

an int representing the partner matching weight between the student whose responses are in row1 and the students whose responses are in row2.

partnermatcher.main.match()[source]

Performs the partner matching algorithm. The algorithm calculates the weight between each pair of students using get_weight(), forms a graph where the nodes are the students and the edge weights are the weights between each pair of students, and then calculates the maximum-weighted matching of the graph, writing the results out to a Google sheet.