-
Notifications
You must be signed in to change notification settings - Fork 117
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
Whales - Camila Tagle #110
base: master
Are you sure you want to change the base?
Conversation
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent first project, Camila! You hit the learning goals and passed all the tests. 🙂🟢
You implemented every function according to the spec; I made notes in places where using a pre-written helper function could've saved some extra work and brain power. Nice job finishing out the tests as well. Keep up the great work!
|
||
# ----------------------------------------- | ||
# ------------- WAVE 3 -------------------- | ||
# ----------------------------------------- | ||
|
||
def get_unique_watched(user_data): | ||
unique_watched = [] | ||
all_watched = set() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great use of a set to capture unique watched!
def get_new_rec_by_genre(user_data): | ||
|
||
rec_movies = get_available_recs(user_data) | ||
genre = get_most_watched_genre(user_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great use of helper functions!
assert INTRIGUE_3 in friends_unique_movies | ||
assert HORROR_1 in friends_unique_movies | ||
assert FANTASY_4 in friends_unique_movies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
|
||
#Assert | ||
|
||
assert len(genre_recomend)==0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
"genre": genre, | ||
"rating": rating | ||
} | ||
if title is None or genre is None or rating is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Usually this would be the first line of our function to check for any None
attributes, and then create and return new_movie
.
|
||
def get_most_watched_genre(user_data): | ||
genre_count={} | ||
if user_data["watched"] == []: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great checking for the if user_data["watched"] == []
case in both this function and get_watched_avg_rating
!
# ----------------------------------------- | ||
# ------------- WAVE 4 -------------------- | ||
# ----------------------------------------- | ||
def get_available_recs(user_data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice implementation; you could've also used get_friends_unique_watched
as a helper function!
rec_movies_genre.append(movie) | ||
return rec_movies_genre | ||
|
||
def get_rec_from_favorites(user_data): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice implementation; you could've also used get_unique_watched
as a helper function!
genre_count[movie["genre"]]+=1 | ||
inverse = [(value, key) for key, value in genre_count.items()] | ||
return max(inverse)[1] | ||
# took this line from https://stackoverflow.com/questions/268272/getting-key-with-maximum-value-in-dictionary / |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for citing
@@ -1,23 +1,134 @@ | |||
# ------------- WAVE 1 -------------------- | |||
import pdb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was this module used for? Debugging?
My ID name is Maria Camila Tagle Ossa, in case you have trouble finding it