Skip to content

Sea Turtles - Heather M. - #14

Open
cathos wants to merge 5 commits into
AdaGold:mainfrom
cathos:master
Open

Sea Turtles - Heather M.#14
cathos wants to merge 5 commits into
AdaGold:mainfrom
cathos:master

Conversation

@cathos

@cathos cathos commented Apr 8, 2022

Copy link
Copy Markdown

No description provided.

@tgoslee tgoslee left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Heather this was a great approach to the swap meet project! Your code was clean, efficient, and readable. I left a few comments on things you did great and things you can refactor. Let me know if you have any questions.

Comment thread swap_meet/clothing.py
pass No newline at end of file
from swap_meet.item import Item

class Clothing(Item):

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/decor.py
pass No newline at end of file
from swap_meet.item import Item

class Decor(Item):

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/electronics.py
pass
from swap_meet.item import Item

class Electronics(Item):

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/item.py
Comment on lines +4 to +18
CATEGORIES = {
"": "Hello World!",
"Clothing": "The finest clothing you could wear.",
"Decor": "Something to decorate your space.",
"Electronics": "A gadget full of buttons and secrets.",
}

CONDITION_DESCRIPTORS = {
0: "Oof. Are you sure you want this?",
1: "Wow. It's pretty bad.",
2: "Significant damage.",
3: "Needs some love.",
4: "Minor signs of wear or damage.",
5: "So good it might be a scam.",
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Heather great job making these global "constant" variables. This helps eliminate redundant code blocks and makes this accessible to other subclasses.

Comment thread swap_meet/item.py
Comment on lines +21 to +29
def __init__(self, category = "", condition = 0):
self.category = category
self.condition = condition

def __str__(self):
return CATEGORIES[self.category]

def condition_description(self):
return CONDITION_DESCRIPTORS[int(self.condition)] 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 thread swap_meet/vendor.py
Comment on lines +46 to +47
swap_items = self.inventory[my_item_index], vendor.inventory[their_item_index]
vendor.inventory[their_item_index], self.inventory[my_item_index] = swap_items

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 job on this streamlined approach. The add and remove methods are now just taking up space. I understand that you technically need them to pass the tests but just wanted to make that note.

Comment thread swap_meet/vendor.py
try:
my_item = self.inventory[0]
their_item = vendor.inventory[0]
self.swap_items(vendor, my_item, their_item)

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 use of your previously created method.

Comment thread swap_meet/vendor.py
except:
return False

def get_best_by_category(self, category):

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
Comment on lines +88 to +89
my_item = self.get_best_by_category(their_priority)
their_item = other.get_best_by_category(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.

great use of previously used methods.

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