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

Update ZipFile to context manager #9843

Merged
merged 7 commits into from
Oct 18, 2022
Merged

Update ZipFile to context manager #9843

merged 7 commits into from
Oct 18, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Oct 18, 2022

Also reject __MACOSX and .DS_Store files from unzipping.

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Refactoring of ZIP file extraction methods for cleaner and more maintainable code.

πŸ“Š Key Changes

  • Removed direct ZipFile imports and usages in dataloaders.py, downloads.py, and general.py.
  • Added a new unzip_file function in general.py to handle ZIP extraction.
  • Updated all the instances where ZIP files were extracted using ZipFile to now use the new unzip_file function.
  • Removed old Google Drive download function and helpers which are no longer needed.

🎯 Purpose & Impact

  • The purpose of these changes is to centralize and simplify the process of unzipping files, which enhances code readability and maintainability. πŸ› 
  • Users should experience no functional change, but the codebase is cleaner and less prone to bugs when handling ZIP file extractions. πŸ“
  • Removal of deprecated Google Drive download code reduces clutter and potential confusion about supported download methods. 🧹

@glenn-jocher glenn-jocher self-assigned this Oct 18, 2022
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.

None yet

1 participant