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

Whales C17 - Julie Warren #94

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Conversation

jawarren89
Copy link

No description provided.

Copy link

@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 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"

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 on lines +18 to +19
self.condition = condition

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 on lines +3 to +8

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

Choose a reason for hiding this comment

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

Nice details!

'''

if category is None:

Choose a reason for hiding this comment

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

👍🏻

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

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(...,...)

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)

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

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

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

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

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