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 #1802

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

Solution #1802

wants to merge 3 commits into from

Conversation

VladikVll
Copy link

Solution for py-car-wash-station

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! 😊 While your implementation of the Car and CarWashStation classes is mostly correct and meets many of the task requirements, there are a couple of critical issues that need to be addressed before we can approve the pull request:

  1. Washing Price Calculation: The method calculate_washing_price seems to have an incorrect formula. Please ensure that the logic used for calculating the washing price aligns with the intended functionality. Double-check the use of self.average_rating / self.distance_from_city_center to confirm it makes sense for your application.

  2. Empty Cars List Check: In the serve_cars method, it's important to check if the list of cars is not empty before proceeding with the washing process. This will help avoid unnecessary operations and potential errors.

Once these issues are resolved, your code will be in great shape! Keep up the great work and feel free to reach out if you have any questions or need further guidance. 🚀

✨ 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.

app/main.py Outdated
Comment on lines 23 to 27
def calculate_washing_price(self, car: Car) -> float:
return round(
car.comfort_class
* (self.clean_power - car.clean_mark)
* self.average_rating / self.distance_from_city_center, 1)

Choose a reason for hiding this comment

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

The calculation of the washing price might not be correct. Ensure that the formula used here aligns with the intended logic for calculating the price. Double-check the use of self.average_rating / self.distance_from_city_center to ensure it makes sense in the context of your application.

app/main.py Outdated
Comment on lines 17 to 21
def serve_cars(self, cars: list[Car]) -> float:
income = 0
for car in cars:
income += self.wash_single_car(car)
return round(income, 1)

Choose a reason for hiding this comment

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

Consider adding a check to ensure that the cars list is not empty before proceeding with the washing process. This will prevent unnecessary operations and potential errors.

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.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

No changes were made in the pull request since the last review. Please make sure that you have added files to the pull request and committed the changes.
[CODE: 7]

If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.

@VladikVll VladikVll marked this pull request as draft January 10, 2025 11:14
@VladikVll VladikVll marked this pull request as ready for review January 10, 2025 11:14
app/main.py Outdated
Comment on lines 18 to 19
if not cars:
return 0

Choose a reason for hiding this comment

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

no need for this check

app/main.py Outdated
Comment on lines 32 to 36
income = 0
if self.clean_power > car.clean_mark:
income += self.calculate_washing_price(car)
car.clean_mark = self.clean_power
return round(income, 1)

Choose a reason for hiding this comment

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

in this method you should change just car clean mark , in serve_cars method you should calculate washing price

Copy link

@viktoria-rybenchuk viktoria-rybenchuk left a comment

Choose a reason for hiding this comment

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

Read the comments

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.

4 participants