Skip to content

Devin - Lions#152

Open
devintaylor122 wants to merge 15 commits intoAda-C18:masterfrom
devintaylor122:master
Open

Devin - Lions#152
devintaylor122 wants to merge 15 commits intoAda-C18:masterfrom
devintaylor122:master

Conversation

@devintaylor122
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@goeunpark goeunpark left a comment

Choose a reason for hiding this comment

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

Wonderful work, Devin! 🎉

I actually do want to print and frame your commit messages because they are the gold standard! ⭐ Your code also shines; I can tell that you understand nested loops, conditionals, testing and modifying lists. This project is a well-deserved Green. 🟢

Keep up the great work! 🎉

Comment thread tests/test_wave_01.py
Comment on lines +122 to +124
assert updated_data["watched"][0]["title"] == MOVIE_TITLE_1
assert updated_data["watched"][0]["genre"] == GENRE_1
assert updated_data["watched"][0]["rating"] == RATING_1
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wonderful assert statements! ✨

Comment thread viewing_party/party.py
Comment on lines 2 to +5




Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Small nit: remove all the unnecessary whitespace before submitting! 😉

Comment thread viewing_party/party.py
Comment on lines +10 to +19
movie = None
if title == None or genre == None or rating == None:
movie == None
else:
movie = {
"title" : title,
"genre" : genre,
"rating" : rating
}
return movie
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

On L12, we check if movie is None, not reassigning movie as None. We can also get rid of the temporary variable and return directly inside the else loop, like so:

if title == None or genre == None or rating == None:
    return None
else:
    return = {
        "title": title,
        "genre": genre,
        "rating": rating
    }

Comment thread viewing_party/party.py
def watch_movie(user_data, title):
for movie in user_data["watchlist"]:
if title in movie["title"]:
user_data["watchlist"].remove(movie)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

One danger of modifying the user_data while iterating is that it could cause an error in our loop. Try to avoid modifying a list while you're iterating through it!

Comment thread viewing_party/party.py
counter = 0
average = 0.0
for movie in user_data["watched"]:
if movie["rating"] == False:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A more pythonic way to write this code is:

if not movie["rating"]:

Comment thread viewing_party/party.py
# ------------- WAVE 4 --------------------
# -----------------------------------------
def get_available_recs(user_data):
unwatched_movies = get_friends_unique_watched(user_data)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice job using get_friends_unique_watched()! 🎉

Comment thread viewing_party/party.py
Comment on lines +114 to +116
for movie in unwatched_movies:
if movie["host"] in user_data["subscriptions"]:
movie_recs.append(movie)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I feel like you can do this in your sleep now! 😴

Comment thread viewing_party/party.py
# ------------- WAVE 5 --------------------
# -----------------------------------------
def get_new_rec_by_genre(user_data):
unwatched_movies = get_friends_unique_watched(user_data)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  • chefs kiss * 👨🏻‍🍳

Comment thread viewing_party/party.py
unwatched_movies = get_friends_unique_watched(user_data)
movie_recs = []
for movie in unwatched_movies:
if movie["genre"] == get_most_watched_genre(user_data):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The efficiency! ⭐

Comment thread viewing_party/party.py
for movie in user_data["favorites"]:
if movie in unwatched_movies:
movie_recs.append(movie)
return movie_recs No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Python likes a newline at the end of the file, otherwise Github shows a silly 🚫

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.

2 participants