Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhauled data.py + Integrated new functions into api.py #6

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

EpicAMC
Copy link

@EpicAMC EpicAMC commented Oct 12, 2023

Added Functions:

  • parse_courses_by_all_geneds: Returns DataFrame of courses matching ALL geneds given in a list of strings.
  • parse_courses_by_geneds: Returns DataFrame of courses matching AT LEAST ONE gened given in a list of strings.
  • parse_courses_by_departments: Returns DataFrame of courses from all of the departments given in a list of strings.
  • parse_courses_by_primary_instructor: Returns DataFrame of courses whose primary instructor name includes the words (separated by spaces) in a given string.
  • parse_courses_by_gpa: Returns DataFrame of courses whose gpa falls within the range of float values min and max
  • parse_courses_by_course_number: Returns DataFrame of courses whose course number matches the given integer
  • parse_courses_by_course_name: Returns DataFrame of courses whose course name includes the words (separated by spaces) in a given string.
  • parse_courses_by_course_levels: Returns DataFrame of courses whose course level is within the range of int values min and max expressed in the hundreds (e.g. min = 100, max = 700)
  • parse_courses_by_class_sizes: Returns DataFrame of courses whose class size is within the range of int values min and max
  • parse_courses_by_criteria_dictionary: Returns DataFrame of courses that match all the criteria given in a criteria dictionary that has some level of leniency with key names and some level of resiliency against incompatible data and where criteria that are not sorted by can be omitted from the dictionary. Example testing code is given near the bottom of the file in a multi-line comment right above the previous deprected/messy function.

I tried to make the code readable, but I'm still a beginner at python and also don't have too much experience in general with the concept of "higher level" readability ¯_(ツ)_/¯

Wrote the big, overall parse_courses_by_criteria_dictionary function for parsing with a lot of criteria. Also wrote a lot of smaller helper functions.

I tried to make the code readable, but I'm still a beginner at python and also don't have too much experience in general with the concept of industry grade readability ¯\_(ツ)_/¯
@EpicAMC
Copy link
Author

EpicAMC commented Oct 12, 2023

Also, I tried my best testing everything along the way, (e.g. tested each function right after I wrote it to make sure its not dumpster fire) but some inputs will probably still cause problems. There's also probably some bad things I did in coding terms that I'm just not conscious of.

@EpicAMC EpicAMC changed the title Overhauled data.py Overhauled data.py + Integrated new functions into api.py Oct 12, 2023
@EpicAMC
Copy link
Author

EpicAMC commented Oct 12, 2023

Update: Integrated new functions into api.py and also updated existing routes to use the improved parsing functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant