You are browsing as a guest. Sign up (or log in) to start making projects!

4h 8m 45s logged

Finished making the Command Line Interface. It checks for availability whenever the user inputs assignments in the questionary interface using sets. Stores all assignments in a dictionary, which is then converted into a cell map after the user finished all assignments. This cell map accurately recreates the cells that were pulled, except that used assignments now get blank cells. School assignments go into a separate sheet, where they are listed as “country name (committee name)”.

During this process I learned a lot about safely converting data between types, i.e. from dictionaries to lists to sets, and their respective advantages for later processing. For example, sets are great with the “in” keyword, which gives O(1) time complexity, an important feature when I expect datasets with 800+ values.

I also learned some intuitive strategies on improving code efficiency. Instead of writing multiple for loops, using tuples to do multiple jobs within one loop is usually much more efficient.

Converting the dictionary that contains {(“committee”, “country_name”): “sheet_coordinate”} into a dictionary with the sheet coordinate as the key and the value as committee and country name took some thought and studying into dictionary rules in python.

The function add_assignments_and_map_cells() took a lot of editing. What started as a simple questionary function that returns user inputs in a dictionary evolved into a full input-checker and cell mapper. I originally wanted the latter process to happen in the main code, but I discovered that the function had all necessary variables, and that it would be cleaner to simply pass back all the completed variables.

Also decided that pushes are inherently untrustworthy, because my data goes from Google Sheets into a dictionary into a cell map, and finally back to Google Sheets. Multiple edge cases and errors may be possible during this time. Implemented a basic checker at the very end to confirm against the counta() function built into the sheet.

Screenshot is not all; have yet to test the code for errors. Very excited to see this work! It used to take dozens of hours to complete, with plenty of human errors (especially double assignments), but with the loop pushing final values after every school and only operating within the list of possible assignments, many human errors are eliminated.

0
1

Comments 0

No comments yet. Be the first!