1313def clean_ingredients (dish_name , dish_ingredients ):
1414 """Remove duplicates from `dish_ingredients`.
1515
16- :param dish_name: str - containing the dish name.
17- :param dish_ingredients: list - dish ingredients.
18- :return: tuple - containing (dish_name, ingredient set).
16+ Parameters:
17+ dish_name (str): The name of the dish.
18+ dish_ingredients (list): The ingredients for the dish.
19+
20+ Returns:
21+ tuple: Containing (dish_name, ingredient set).
1922
2023 This function should return a `tuple` with the name of the dish as the first item,
2124 followed by the de-duped `set` of ingredients as the second item.
25+
2226 """
2327
2428 return dish_name , set (dish_ingredients )
@@ -27,12 +31,16 @@ def clean_ingredients(dish_name, dish_ingredients):
2731def check_drinks (drink_name , drink_ingredients ):
2832 """Append "Cocktail" (alcohol) or "Mocktail" (no alcohol) to `drink_name`, based on `drink_ingredients`.
2933
30- :param drink_name: str - name of the drink.
31- :param drink_ingredients: list - ingredients in the drink.
32- :return: str - drink_name appended with "Mocktail" or "Cocktail".
34+ Parameters:
35+ drink_name (str): Name of the drink.
36+ drink_ingredients (list): Ingredients in the drink.
37+
38+ Returns:
39+ str: drink_name appended with "Mocktail" or "Cocktail".
3340
3441 The function should return the name of the drink followed by "Mocktail" (non-alcoholic) and drink
3542 name followed by "Cocktail" (includes alcohol).
43+
3644 """
3745
3846 if not ALCOHOLS .isdisjoint (drink_ingredients ):
@@ -44,13 +52,16 @@ def check_drinks(drink_name, drink_ingredients):
4452def categorize_dish (dish_name , dish_ingredients ):
4553 """Categorize `dish_name` based on `dish_ingredients`.
4654
47- :param dish_name: str - dish to be categorized.
48- :param dish_ingredients: list - ingredients for the dish.
49- :return: str - the dish name appended with ": <CATEGORY>".
55+ Parameters:
56+ dish_name (str): The dish to be categorized.
57+ dish_ingredients (set): The ingredients for the dish.
58+
59+ Returns:
60+ str: TThe dish name appended with ": <CATEGORY>".
5061
5162 This function should return a string with the `dish name: <CATEGORY>` (which meal category the dish belongs to).
5263 `<CATEGORY>` can be any one of (VEGAN, VEGETARIAN, PALEO, KETO, or OMNIVORE).
53- All dishes will "fit" into one of the categories imported from `sets_categories_data.py`
64+ All dishes will "fit" into one of the categories imported from `sets_categories_data.py`.
5465
5566 """
5667
@@ -69,8 +80,11 @@ def categorize_dish(dish_name, dish_ingredients):
6980def tag_special_ingredients (dish ):
7081 """Compare `dish` ingredients to `SPECIAL_INGREDIENTS`.
7182
72- :param dish: tuple - of (dish name, list of dish ingredients).
73- :return: tuple - containing (dish name, dish special ingredients).
83+ Parameters:
84+ dish (tuple): (dish name, list of dish ingredients).
85+
86+ Returns:
87+ tuple: Containing (dish name, dish special ingredients).
7488
7589 Return the dish name followed by the `set` of ingredients that require a special note on the dish description.
7690 For the purposes of this exercise, all allergens or special ingredients that need to be tracked are in the
@@ -81,12 +95,17 @@ def tag_special_ingredients(dish):
8195
8296
8397def compile_ingredients (dishes ):
84- """Create a master list of ingredients.
98+ """Determine which `dishes` are designated `appetizers` and remove them.
99+
100+ Parameters:
101+ dishes (list): Group of dish names.
102+ appetizers (list): Group of appetizer names.
85103
86- :param dishes: list - of dish ingredient sets.
87- :return: set - of ingredients compiled from `dishes` .
104+ Returns:
105+ list: Group of dish names that do not appear on appetizer list .
88106
89- This function should return a `set` of all ingredients from all listed dishes.
107+ The function should return the list of dish names with appetizer names removed.
108+ Either list could contain duplicates and may require de-duping.
90109 """
91110
92111 combined_ingredients = set ()
@@ -100,9 +119,12 @@ def compile_ingredients(dishes):
100119def separate_appetizers (dishes , appetizers ):
101120 """Determine which `dishes` are designated `appetizers` and remove them.
102121
103- :param dishes: list - of dish names.
104- :param appetizers: list - of appetizer names.
105- :return: list - of dish names that do not appear on appetizer list.
122+ Parameters:
123+ dishes (list): Group of dish names.
124+ appetizers (list): Group of appetizer names.
125+
126+ Returns:
127+ list: Group of dish names that do not appear on appetizer list.
106128
107129 The function should return the list of dish names with appetizer names removed.
108130 Either list could contain duplicates and may require de-duping.
@@ -114,13 +136,16 @@ def separate_appetizers(dishes, appetizers):
114136def singleton_ingredients (dishes , intersection ):
115137 """Determine which `dishes` have a singleton ingredient (an ingredient that only appears once across dishes).
116138
117- :param dishes: list - of ingredient sets.
118- :param intersection: constant - can be one of `<CATEGORY>_INTERSECTION` constants imported from `sets_categories_data.py`.
119- :return: set - containing singleton ingredients.
139+ Parameters:
140+ dishes (list): Group of ingredient sets.
141+ intersection (constant): Can be one of `<CATEGORY>_INTERSECTIONS` constants imported from `sets_categories_data.py`.
142+
143+ Returns:
144+ set: Containing singleton ingredients.
120145
121146 Each dish is represented by a `set` of its ingredients.
122147
123- Each `<CATEGORY>_INTERSECTION ` is an `intersection` of all dishes in the category. `<CATEGORY>` can be any one of:
148+ Each `<CATEGORY>_INTERSECTIONS ` is an `intersection` of all dishes in the category. `<CATEGORY>` can be any one of:
124149 (VEGAN, VEGETARIAN, PALEO, KETO, or OMNIVORE).
125150
126151 The function should return a `set` of ingredients that only appear in a single dish.
0 commit comments