Skip to content

Lindsay and Hannahs Viewing Party#37

Open
lindsaybolz wants to merge 28 commits into
AdaGold:mainfrom
Hannah1Watkins:main
Open

Lindsay and Hannahs Viewing Party#37
lindsaybolz wants to merge 28 commits into
AdaGold:mainfrom
Hannah1Watkins:main

Conversation

@lindsaybolz
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Contributor

@audreyandoy audreyandoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work Lindsay and Hannah! You hit all the learning goals for this project and all tests are passing. You have earned a well-deserved 🟢 grade on this project ✨

I added comments, compliments, and hints on ways to refactor your code.

Keep up the great work! ✨

Comment thread tests/test_wave_01.py
Comment on lines +154 to +159
expected = {
"watchlist" : [],
"watched" : [{"title": MOVIE_TITLE_1,
"genre": GENRE_1,
"rating": RATING_1}]
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread tests/test_wave_01.py
# *******************************************************************************************
# ****** Add assertions here to test that the correct movie was added to "watched" **********
# *******************************************************************************************
assert updated_data == expected
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread tests/test_wave_01.py
Comment on lines +181 to +186
expected = {
"watchlist" : [
FANTASY_1,
],
"watched" : [FANTASY_2, movie_to_watch]
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread tests/test_wave_03.py
Comment on lines +59 to +60
assert INTRIGUE_3 in friends_unique_movies
assert amandas_data == expected
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread tests/test_wave_05.py
Comment on lines +55 to +59
# Act
recommendations = get_new_rec_by_genre(sonyas_data)

# Assert
assert len(recommendations) == 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread viewing_party/party.py
Comment on lines +122 to +127
for friend in user_data["friends"]:
for movie in friend["watched"]:
if movie["title"] in friends_unique_watched_titles:
if movie["title"] not in added_titles:
friends_unique_watched_movies.append(movie)
added_titles.append(movie["title"])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A helper function that creates single list of all the friend's movies would be helpful in condensing this function a bit.

Comment thread viewing_party/party.py
Comment on lines +137 to +148
def get_available_recs(user_data):
# create subscriotions, user_watched, and friends_watched lists
subscriptions = set(user_data["subscriptions"])
user_watched_titles = get_user_watched_titles(user_data)
friends_watched = get_friends_unique_watched(user_data)

# find the movies that are not in user watched and that are available with subscriptions
recommended = []
for movie in friends_watched:
if movie['title'] not in user_watched_titles and movie['host'] in subscriptions:
recommended.append(movie)
return recommended
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread viewing_party/party.py
Comment on lines +157 to +167
def get_new_rec_by_genre(user_data):
# get most freq genere and friends watched.
most_frequent_genre = get_most_watched_genre(user_data)
friends_watched = get_friends_unique_watched(user_data)

# find recommendations if user hasnt watched and genre is most freq
recommendations = []
for movie in friends_watched:
if movie not in user_data['watched'] and movie['genre'] == most_frequent_genre:
recommendations.append(movie)
return recommendations
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread viewing_party/party.py
def get_rec_from_favorites(user_data):
# create favorites and user_watched_titles
favorites = user_data["favorites"]
user_watched_titles = [movie['title'] for movie in get_unique_watched(user_data)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work using list comprehension 🔥

Comment thread viewing_party/party.py
Comment on lines +175 to +181
# get recommendations if the movie is in faves and unique user movies
recommendations = []
for movie in favorites:
if movie['title'] in user_watched_titles:
recommendations.append(movie)

return recommendations No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could return the list literal from the list comprehension like so:

return [ movie for movie in favorites if movie['title'] in user_watched_titles]

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.

3 participants