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

Sea Turtles Theresa D #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Sea Turtles Theresa D #120

wants to merge 1 commit into from

Conversation

perugia33
Copy link

project 1 view_party submission

Copy link

@tgoslee tgoslee left a comment

Choose a reason for hiding this comment

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

Theresa this was a good start to your project. I think that I can see why a few of your tests are failing. We do not want to make our own data/override user_data. You want to use the given parameters. When the functions are invoked that's when data would be added using the parameters. Let's schedule a time to talk through it.


keys = ["title", "genre", "rating"]
values = [movie_title, genre, rating]
new_movie = {}
Copy link

Choose a reason for hiding this comment

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

Instead of creating an empty dictionary, you can build a dictionary literal an example could look like

if title and genre and rating:
        movie =  {
            "title": title,
            "genre": genre,
            "rating": rating
            }
        return movie

values = [movie_title, genre, rating]
new_movie = {}

if movie_title == None:
Copy link

Choose a reason for hiding this comment

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

Here you are supposed to check if this is truthy but this only checks for None. To check if it's truthy you could so something like if not title or not genre or not rating:

Comment on lines +22 to +28
user_data = {
"watched": []
}
new_list = [ ]
new_list.append(movie)

user_data["watched"]= new_list
Copy link

Choose a reason for hiding this comment

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

you do not need to create user_data because its already being passed in as a parameter you would just need to do

    # add movie to what user has watched
    user_data["watched"].append(movie)
    return user_data

Comment on lines +33 to +40
user_data = {
"watchlist": []
}
new_list = [ ]
new_list.append(movie)

user_data["watchlist"]= new_list
return user_data
Copy link

Choose a reason for hiding this comment

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

same as above you could just do

def add_to_watchlist(user_data, movie):
    # add movie to user's watchlist
    user_data["watchlist"].append(movie)
    return user_data

user_data["watchlist"]= new_list
return user_data

def watch_movie(user_data, MOVIE_TITLE_1):
Copy link

Choose a reason for hiding this comment

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

Careful here! We don't want to accidentally overwrite the user_data's "watchlist" that's already been supplied to us in the tests in test_wave_01.py. It did pass the tests, but unfortunately, the tests did not account for "watchlist" with more than one movie in them.
Make sure we use the user_data instead, update it there, then return the user_data

INTRIGUE_1,
INTRIGUE_3,
]
def get_unique_watched(user_data):
Copy link

Choose a reason for hiding this comment

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

how could you create a helper function to get the data you need for this function and for get_friends_unique_watched ?

friends_watched = []
comparison_list =[]
recommendations = []
def get_available_recs(user_data):
Copy link

Choose a reason for hiding this comment

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

think about the function get_friends_unique_watched(). How could it be used in this function?

for movie in comparison_list:
if movie["host"] in user_data["subscriptions"]:
recommendations.append(movie)
# print(f"friends watched: {friends_watched}")
Copy link

Choose a reason for hiding this comment

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

remove these comments you aren't using


def get_rec_from_favorites(user_data):
favorites_rec = []
user_watched_list = get_unique_watched(user_data)
Copy link

Choose a reason for hiding this comment

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

great use of a helper function here.

# -----------------------------------------
# ------------- WAVE 5 --------------------
# -----------------------------------------

new_list= []
recommendations_list = []
def get_new_rec_by_genre(USER_DATA_5):
Copy link

Choose a reason for hiding this comment

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

we don't want to override user_data here. Change the parameter back to user_data and think about what helper function you could use here.

@perugia33
Copy link
Author

perugia33 commented Apr 1, 2022 via email

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