-
Notifications
You must be signed in to change notification settings - Fork 167
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
Alma_C18 #149
base: master
Are you sure you want to change the base?
Alma_C18 #149
Conversation
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, Alma! This project is green. 🟢
You implemented every function according to the specification and had fantastic code style throughout. Very great use of helper functions, set logic, and parsing nested data structures. Nice job finishing out the tests as well. See my line-by-line comments for more detail. Keep up the great work!
@@ -119,12 +119,15 @@ def test_moves_movie_from_watchlist_to_empty_watched(): | |||
assert len(updated_data["watchlist"]) == 0 | |||
assert len(updated_data["watched"]) == 1 | |||
|
|||
raise Exception("Test needs to be completed.") | |||
#Mine below: | |||
assert updated_data["watched"][0]['title'] == MOVIE_TITLE_1 |
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.
👍🏻
@@ -143,12 +146,16 @@ def test_moves_movie_from_watchlist_to_watched(): | |||
assert len(updated_data["watchlist"]) == 1 | |||
assert len(updated_data["watched"]) == 2 | |||
|
|||
raise Exception("Test needs to be completed.") | |||
#Mine teste below: | |||
assert updated_data["watched"][-1]['title'] == movie_to_watch["title"] |
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 use of index -1 to access the last element!
# ************************************************************************************************* | ||
# ****** Add assertions here to test that the correct movies are in friends_unique_movies ********** | ||
# ************************************************************************************************** | ||
assert INTRIGUE_3 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.
👍🏻
recommendations = get_new_rec_by_genre(sonyas_data) | ||
|
||
# # # raise Exception("Test needs to be completed.") | ||
assert len(recommendations) == 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.
Great!
new_movie = { } | ||
|
||
# if an argument is None, return None | ||
if title == None or genre == None or rating == 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.
www.pythontutorial.net/advanced-python/python-none/) gives a good explanation why! It gets into how python objects' equality is defined, something we'll cover in OOP.
return movies_only_final_list_dict | ||
|
||
#*************************************************************************************************** | ||
def get_friends_unique_watched(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.
Similar to above, wonderful implementation!
for title in movies_only_final_list: | ||
for friend in user_data['friends']: | ||
for movie in friend['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 parsing the nested data structure!
friends_genre = [] | ||
recommended_movies = [] | ||
|
||
genre_max = 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! A helper function is very helpful here.
user_watched = user_data['watched'] #list,dict | ||
friends = user_data['friends'] | ||
user_genre = [] | ||
friends_genre = [] | ||
recommended_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.
Great variable naming 👍🏻
friends_users = [] | ||
recommended_movies = [] | ||
|
||
# if the user doesn't have favorites, it's equal length cero, then return an empty list. |
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 comments outlining logical steps!
No description provided.