Skip to content
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

Sapphire - Anna Lima #65

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open

Sapphire - Anna Lima #65

wants to merge 32 commits into from

Conversation

annavanwesep
Copy link

No description provided.

Edith and others added 30 commits March 27, 2023 11:57
git commit -m 'wave 01 success!'
q

exit
/
@annavanwesep
Copy link
Author

No description provided.

Edith worked on this code as you can see from the commits :)

Copy link

@tildeee tildeee left a comment

Choose a reason for hiding this comment

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

Well done on this project, you two! This project is marked as a "green."

Overall, your project code is looking great. It's straightforward and good logic. To be honest, the code is readable and straightforward enough, I think that your code may speak for itself-- if you felt like deleting some if your comments, I think your code would still look good. My feedback is mostly around small, optional opportunities for refactoring.

Also, your tests look good! Your team contract and team reflections also look good!

Additionally, your git hygiene is pretty good. However, I would expect the commit messages to generally start with a verb and describe the code changes in the commit (and less "Wave 2 passes" etc). Sometimes merge commits simply say "merge" though, so you all were right. The commit frequency is what I would expect and look for though :) Edith, if your git is still in a weird state, let me know and we can try to get it fixed together!

Again, the project is great overall. Good work, keep it up.

Comment on lines +7 to +12
if not title:
return None
if not genre:
return None
if not rating:
return None
Copy link

Choose a reason for hiding this comment

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

The line return None is repeated here a few times. This code is readable and concise as-is. But for optional refactoring, maybe we can make this more DRY

genre_dict[movie_genre] += 1

#return genre with highest value from genre_dict
most_popular_genre = max(genre_dict, key=genre_dict.get)
Copy link

Choose a reason for hiding this comment

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

Fantastic use of max :D It helped shave a whole loop here.

Comment on lines +128 to +129
for movie in friends_watched_movies:
friend_movie_list += movie["watched"]
Copy link

Choose a reason for hiding this comment

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

In my opinion, more appropriate variable names might be:

    friends = user_data['friends']
    friend_movie_list = []
    for friend in friends:
        friend_movie_list += friend["watched"]

Comment on lines +181 to +184
for movie in friend_movie_list:
movie_host = movie['host']
#if the movie host is also in the subscriptions that the user has; the user hasn't watched the movie yet
if movie_host in service_subscriptions and movie not in user_watched_movies and movie not in recs:
Copy link

Choose a reason for hiding this comment

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

In this situation, since movie_host is only used once, I find it fairly readable to refactor this to:

        for movie in friend_movie_list:
            #if the movie host is also in the subscriptions that the user has; the user hasn't watched the movie yet
            if movie['host'] in service_subscriptions and movie not in user_watched_movies and movie not in recs:

The tests still pass with this change, too!

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