Whales - Camila Tagle#110
Conversation
|
Done |
There was a problem hiding this comment.
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!
|
|
||
| def get_unique_watched(user_data): | ||
| unique_watched = [] | ||
| all_watched = set() |
There was a problem hiding this comment.
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) |
| assert INTRIGUE_3 in friends_unique_movies | ||
| assert HORROR_1 in friends_unique_movies | ||
| assert FANTASY_4 in friends_unique_movies |
|
|
||
| #Assert | ||
|
|
||
| assert len(genre_recomend)==0 |
| "genre": genre, | ||
| "rating": rating | ||
| } | ||
| if title is None or genre is None or rating is None: |
There was a problem hiding this comment.
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.
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.
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.
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 / |
| @@ -1,23 +1,134 @@ | |||
| # ------------- WAVE 1 -------------------- | |||
| import pdb | |||
There was a problem hiding this comment.
What was this module used for? Debugging?
My ID name is Maria Camila Tagle Ossa, in case you have trouble finding it