Open
Conversation
…ronics: Wave 5 / Tests 1 thru 3
…te and condition description method: Wave 5 / Tests 4 and 5
…ms: Wave 6 / Tests 4 thru 6
…item: Wave 6 / Tests 7 thru 9. Passed integration tests.
jericahuang
reviewed
May 18, 2022
jericahuang
left a comment
There was a problem hiding this comment.
Wonderful work on this project, Julie! You demonstrated mastery of Unit 1 concepts and had fantastic code style and implementations throughout. 👍🏻 Great job for both the function definitions and completing the tests! Your project is green 🟢 !
Comment on lines
+4
to
+9
| ''' | ||
| A sub-class of Item, indicating a type of item a vendor might have. | ||
|
|
||
| Attributes: | ||
| condition (float): optional descr. of item condition, 0 if not defined | ||
| category (str): description of item category, always set to "Clothing" |
There was a problem hiding this comment.
Yay docstrings! Great use of them here and throughout your code!
Comment on lines
+18
to
+19
| self.category = "Decor" | ||
| self.condition = condition |
There was a problem hiding this comment.
Great! Another option that works is calling the constructor of the parent (Item) class like super().__init__(condition=condition, category='Decor')
Comment on lines
+3
to
+8
| A class indicating an object Item that a vendor might have. | ||
|
|
||
| Attributes: | ||
| category (str): optional descr. of item category. None if not defined, | ||
| w/attribute set to an empty string. Otherwise set to input param. | ||
| condition (float): optional descr. of item condition, 0 if not defined |
| condition (float): optional descr. of item condition, 0 if not defined | ||
| ''' | ||
|
|
||
| if category is None: |
|
|
||
| if len(self.inventory) >= 1 and len(other_vendor.inventory) >= 1: | ||
| self.swap_items(other_vendor, self.inventory[0], other_vendor.inventory[0]) | ||
| return True |
There was a problem hiding this comment.
Yes! You could also take advantage of the fact that .swap_items returns True or False and return self.swap_items(...,...)
| best_their_priority = self.get_best_by_category(their_priority) | ||
| best_my_priority = other.get_best_by_category(my_priority) | ||
| if best_their_priority and best_my_priority: | ||
| self.swap_items(other, best_their_priority, best_my_priority) |
Comment on lines
+52
to
+54
| assert item not in vendor.inventory | ||
| assert len(vendor.inventory) == 3 | ||
| assert result == False No newline at end of file |
Comment on lines
+80
to
+88
| assert result | ||
| assert len(tai.inventory) == 3 | ||
| assert item_a in tai.inventory | ||
| assert item_b in tai.inventory | ||
| assert item_f in tai.inventory | ||
| assert len(jesse.inventory) == 3 | ||
| assert item_d in jesse.inventory | ||
| assert item_e in jesse.inventory | ||
| assert item_c in jesse.inventory |
Comment on lines
+202
to
+210
| assert not result | ||
| assert len(tai.inventory) == 3 | ||
| assert item_a in tai.inventory | ||
| assert item_b in tai.inventory | ||
| assert item_c in tai.inventory | ||
| assert len(jesse.inventory) == 3 | ||
| assert item_d in jesse.inventory | ||
| assert item_e in jesse.inventory | ||
| assert item_f in jesse.inventory |
Comment on lines
+237
to
+245
| assert not result | ||
| assert len(tai.inventory) == 3 | ||
| assert item_a in tai.inventory | ||
| assert item_b in tai.inventory | ||
| assert item_c in tai.inventory | ||
| assert len(jesse.inventory) == 3 | ||
| assert item_d in jesse.inventory | ||
| assert item_e in jesse.inventory | ||
| assert item_f in jesse.inventory No newline at end of file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.