Skip to content

Comments

Code Sub, Andrea Yuson, Maple Homeroom#90

Open
ASY13 wants to merge 1 commit intoAda-C16:masterfrom
ASY13:master
Open

Code Sub, Andrea Yuson, Maple Homeroom#90
ASY13 wants to merge 1 commit intoAda-C16:masterfrom
ASY13:master

Conversation

@ASY13
Copy link

@ASY13 ASY13 commented Sep 17, 2021

Shoutout to Trinisha and Claire for your patience and guidance,much appreciated.

Copy link

@spitsfire spitsfire left a comment

Choose a reason for hiding this comment

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

great job on your first project, Andrea! I made a couple suggestions about pulling some functions apart and turning them into helper functions, but all in all you did amazing!

@@ -0,0 +1,130 @@
#wave 1
def create_movie(movie_title,genre,rating):

Choose a reason for hiding this comment

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

👍

else:
return None

def add_to_watched(user_data,movie_title):

Choose a reason for hiding this comment

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

👍

watched_list.append(movie_title)
return user_data

def add_to_watchlist(user_data,movie_title):

Choose a reason for hiding this comment

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

👍

Comment on lines +23 to +24
movies_watched = user_data['watched']
movies_to_watch = user_data['watchlist']

Choose a reason for hiding this comment

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

nicely done making variables that help isolate and describe what kind of data you are working with


for movie in movies_to_watch:
if movie_title == movie['title']:
movies_watched.append(movie)

Choose a reason for hiding this comment

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

this is a very redundant suggestion since this is only one line of code and thus works just fine, but where have we seen this before?

maybe we could use add_to_watched to do this for us. Again, suuuper unnecessary change to make in the scheme of things, so think of this as just something to consider for next time.

Comment on lines +100 to +102
if movie["genre"] == user_most_watched_genre:
if movie not in movie_recs_list:
movie_recs_list.append(movie)

Choose a reason for hiding this comment

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

we could put this into a compound conditional statement:

Suggested change
if movie["genre"] == user_most_watched_genre:
if movie not in movie_recs_list:
movie_recs_list.append(movie)
if movie["genre"] == user_most_watched_genre and movie not in movie_recs_list:
movie_recs_list.append(movie)

Comment on lines +90 to +92
if movie["host"] in host:
if movie not in rec_list:
rec_list.append(movie)

Choose a reason for hiding this comment

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

we could put this into a compound conditional statement:

Suggested change
if movie["host"] in host:
if movie not in rec_list:
rec_list.append(movie)
if movie["host"] in host and movie not in rec_list:
rec_list.append(movie)

if movie not in movie_recs_list:
movie_recs_list.append(movie)
return movie_recs_list
def get_rec_from_favorites(user_data):

Choose a reason for hiding this comment

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

👍

movie_recs_list.append(movie)
return movie_recs_list
def get_rec_from_favorites(user_data):
user_unique_list = get_unique_watched(user_data)

Choose a reason for hiding this comment

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

yay helper functions!

Comment on lines +111 to +130
# def get_new_rec_by_genre(user_data):
# recommended_genre = []
# new_list = []
# fave_genre = get_most_watched_genre(user_data)
# for movie in user_data["friends"]:
# for i in movie["watched"]:
# new_list.append(i)
# for movie in new_list:
# if movie["genre"] == fave_genre:
# recommended_genre.append(movie)
# return recommended_genre
# def get_rec_from_favorites(user_data):
# recs_from_faves = []
# unique_watched_list = get_unique_watched(user_data)
# faves = user_data["favorites"]
# for movie in unique_watched_list:
# if movie in faves:
# recs_from_faves.append(movie)
# return recs_from_faves
# def get_new_rec_by_genre: No newline at end of file

Choose a reason for hiding this comment

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

Suggested change
# def get_new_rec_by_genre(user_data):
# recommended_genre = []
# new_list = []
# fave_genre = get_most_watched_genre(user_data)
# for movie in user_data["friends"]:
# for i in movie["watched"]:
# new_list.append(i)
# for movie in new_list:
# if movie["genre"] == fave_genre:
# recommended_genre.append(movie)
# return recommended_genre
# def get_rec_from_favorites(user_data):
# recs_from_faves = []
# unique_watched_list = get_unique_watched(user_data)
# faves = user_data["favorites"]
# for movie in unique_watched_list:
# if movie in faves:
# recs_from_faves.append(movie)
# return recs_from_faves
# def get_new_rec_by_genre:

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