Skip to content

Whales C17 - Julie Warren#94

Open
jawarren89 wants to merge 16 commits intoada-c17:masterfrom
jawarren89:master
Open

Whales C17 - Julie Warren#94
jawarren89 wants to merge 16 commits intoada-c17:masterfrom
jawarren89:master

Conversation

@jawarren89
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@jericahuang jericahuang left a comment

Choose a reason for hiding this comment

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

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 thread swap_meet/clothing.py
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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yay docstrings! Great use of them here and throughout your code!

Comment thread swap_meet/decor.py
Comment on lines +18 to +19
self.category = "Decor"
self.condition = condition
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great! Another option that works is calling the constructor of the parent (Item) class like super().__init__(condition=condition, category='Decor')

Comment thread swap_meet/item.py
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice details!

Comment thread swap_meet/item.py
condition (float): optional descr. of item condition, 0 if not defined
'''

if category is None:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍🏻

Comment thread swap_meet/vendor.py

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes! You could also take advantage of the fact that .swap_items returns True or False and return self.swap_items(...,...)

Comment thread swap_meet/vendor.py
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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Awesome use of helper functions!

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍🏻

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍🏻

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍🏻

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍🏻

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