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

Apply ruff==0.9.0 formatting #13486

Merged
merged 2 commits into from
Jan 10, 2025
Merged

Apply ruff==0.9.0 formatting #13486

merged 2 commits into from
Jan 10, 2025

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jan 10, 2025

This Ultralytics PR reformats this repo with the latest improved Ruff version 0.9.0 formatter.

Learn more about Ultralytics:

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Updated text in multiple scripts and documentation files for consistency, readability, and modern formatting styles.

📊 Key Changes

  • AWS Instance Updates: Updated references from AWS p3.2xlarge to p4 instances in README files (both English and Chinese).
  • String Formatting Modernization: Replaced single quotes (') with double quotes (") for string consistency across various scripts.
  • Variable Assignments Simplification: Leveraged Python's inline assignment (:=) to make code more concise.
  • Error Message Formatting: Consolidated and updated error messages for better clarity and uniform formatting.
  • Code Cleanup: Removed commented and unused legacy code in augmentation scripts.

🎯 Purpose & Impact

  • Improved Documentation: The update aligns the documentation with the latest AWS instance types, ensuring relevance for users.
  • Enhanced Consistency: Improved code and text consistency makes the repository easier to understand and maintain.
  • Modernized Code: Adopting newer Python syntax improves readability and aligns with contemporary coding best practices.
  • Streamlined Error Handling: Clearer error messages enhance developer experience during debugging.

➡️ Overall, these changes refine usability and code comprehension without impacting core functionality. 🚀

@UltralyticsAssistant UltralyticsAssistant added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 10, 2025
@UltralyticsAssistant
Copy link
Member

👋 Hello @glenn-jocher, thank you for submitting a thorough ultralytics/yolov5 🚀 pull request! To help streamline the review and integration process, please ensure the following checklist is addressed:

  • Clearly Define Your PR Goals: Please ensure your PR description explains the purpose of your changes clearly. If relevant, link the associated issues to provide additional context.
  • Ensure Synchronization: Confirm your branch is up to date with the main branch of the ultralytics/yolov5 repository. If your branch is behind, click the "Update branch" button or run git pull and git merge main locally.
  • Pass CI Tests: Ensure all Continuous Integration (CI) checks pass successfully. If any fail, please address them before requesting a review.
  • Update Documentation: If this PR introduces or modifies functionality, update the necessary documentation.
  • Add or Update Tests: If applicable, provide tests to validate your changes. Ensure all existing and new tests pass.
  • Sign the Contributor License Agreement (CLA): If this is your first contribution to Ultralytics, please sign the CLA by commenting “I have read the CLA Document and I hereby sign the CLA”.
  • Focus on Minimal Changes: Limit your submitted changes to only what's necessary for your feature or fix. Quoting Bruce Lee: "It is not daily increase but daily decrease, hack away the unessential."

Learn more about Ultralytics:

🔧 PR Summary

This PR introduces the following updates:

  • Reformats the yolov5 repo using ruff==0.9.0, showcasing Python's latest walrus operator (:=) for simplification and enhanced readability across multiple modules (augmentations, dataloaders, etc.).
  • Updates documentation to improve clarity, including benchmark details with updated AWS instance references.
  • Introduces minor syntax improvements, such as dictionary merging (|=), aligning with Python 3.8+ standards.
  • Cleans up redundant code and improves maintainability by removing unused visualizations and variables.

Thank you for your efforts to keep the yolov5 codebase modern and efficient! An Ultralytics engineer will review this PR soon 🛠️. In the meantime, if you have additional questions or updates, feel free to comment here. Cheers! 😊

@glenn-jocher glenn-jocher merged commit 86fd1ab into master Jan 10, 2025
9 checks passed
@glenn-jocher glenn-jocher deleted the refactor-20250110012830 branch January 10, 2025 00:42
@UltralyticsAssistant
Copy link
Member

🎉 Your PR has been merged, @glenn-jocher! Thank you for your incredible work refining consistency, modernizing formatting, and elevating user experience across the board. These changes may feel subtle, but as Marcus Aurelius once said, "The secret of all victory lies in the organization of the non-obvious." With every thoughtful update, you're paving the way for a clearer, more powerful repository that will benefit countless users—today and in the future. 🚀 Keep inspiring excellence! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants