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

Solution #1603

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

Solution #1603

wants to merge 2 commits into from

Conversation

kmalashchuk
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Thank you for your hard work on this project! However, there are a few critical issues that need to be addressed before we can approve the pull request. Specifically, the parameter naming and type mismatches in several parts of the code, such as in the CinemaBar class and the cinema_visit function, need to be corrected to meet the task requirements. Additionally, ensure that the movie_session method in the CinemaHall class uses the correct parameter name. Once these issues are resolved, your code will be in great shape! Keep up the great work, and don't hesitate to reach out if you need any help. 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.


class CinemaBar:
@staticmethod
def sell_product(product: str, customers: Customer) -> None:

Choose a reason for hiding this comment

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

The parameter name customers should be customer to match the task description, which specifies that the sell_product method takes a single Customer instance as customer.

class CinemaBar:
@staticmethod
def sell_product(product: str, customers: Customer) -> None:
print(f"Cinema bar sold {product} to {customers} ")

Choose a reason for hiding this comment

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

The placeholder in the formatted string should use customer.name instead of customers to correctly display the customer's name. Ensure the parameter name is corrected to customer as well.

app/main.py Outdated
from app.people.cinema_staff import Cleaner


def cinema_visit(customers: Customer, hall_number: CinemaHall, cleaner: Cleaner, movie: CinemaHall):

Choose a reason for hiding this comment

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

The parameter types in the function signature are incorrect. customers should be a list of dictionaries, hall_number should be an integer, and movie should be a string. Update the function signature to reflect these types.

customer_instances = [Customer(name=c["name"], food=c["food"]) for c in customers]
cleaning_staff = Cleaner(name=cleaner)
for customer in customer_instances:
CinemaBar.sell_product(product=customer.food, customer = customer)

Choose a reason for hiding this comment

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

The sell_product method call has a parameter naming issue. The correct parameter name should be customer instead of customer to match the method definition in CinemaBar.

cleaning_staff = Cleaner(name=cleaner)
for customer in customer_instances:
CinemaBar.sell_product(product=customer.food, customer = customer)
cinema_hall = CinemaHall(number=hall_number)

Choose a reason for hiding this comment

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

The hall_number parameter should be an integer, not a CinemaHall instance. Update the instantiation of CinemaHall to use the correct type.

for customer in customer_instances:
CinemaBar.sell_product(product=customer.food, customer = customer)
cinema_hall = CinemaHall(number=hall_number)
cinema_hall.movie_session(movie_name=movie, customers=customer_instances, cleaning_staff=cleaning_staff)

Choose a reason for hiding this comment

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

The movie_name parameter in movie_session should be a string, not a CinemaHall instance. Ensure that the movie parameter is passed as a string.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on your submission! 🎉 While your implementation is mostly correct, there are a few areas that need attention to fully align with the task requirements:

  1. Parameter Naming in movie_session Method: Ensure that the parameter name is consistent with the task description. It should be movie_name instead of movies_name.

  2. Parameter Naming in cinema_visit Function: The parameter should be customers to accurately represent that it is a list, as per the task description.

  3. Cleaner Class Initialization: The hall_number parameter in the constructor is redundant and should be removed since the clean_hall method already takes a hall_number parameter.

  4. Output Formatting in CinemaBar: Modify the print statement to correctly display the customer's name by accessing the name attribute of the Customer instance.

These issues are important for the functionality of your code, and addressing them will enhance your understanding and skills. Keep up the good work, and use this feedback to improve your code in future tasks. Remember, learning from these experiences is key to becoming a better developer! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

class CinemaBar:
@staticmethod
def sell_product(product: str, customer: Customer) -> None:
print(f"Cinema bar sold {product} to {customer} ")

Choose a reason for hiding this comment

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

The print statement currently outputs the Customer object directly, which may not display the customer's name as intended. You should modify the statement to access the name attribute of the Customer instance, like this: print(f"Cinema bar sold {product} to {customer.name}").

from app.people.cinema_staff import Cleaner


def cinema_visit(customer: list, hall_number: int, cleaner: str, movie: str):

Choose a reason for hiding this comment

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

The parameter customer should be renamed to customers to accurately reflect that it is a list of customer dictionaries, as per the task description.

for customer in customer_instances:
CinemaBar.sell_product(product=customer.food, customer = customer)
cinema_hall = CinemaHall(number=hall_number)
cinema_hall.movie_session(movie_name=movie, customers=customer_instances, cleaning_staff=cleaning_staff)

Choose a reason for hiding this comment

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

The parameter movie_name in the movie_session method call should be movies_name to match the parameter name defined in the CinemaHall class.

@@ -0,0 +1,7 @@
class Cleaner:
def __init__(self, name: str, hall_number: int) -> None:

Choose a reason for hiding this comment

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

The hall_number parameter in the constructor is redundant because the clean_hall method already accepts a hall_number parameter. Consider removing hall_number from the constructor to simplify the class design.

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