Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Conversation

@ternaus
Copy link
Collaborator

@ternaus ternaus commented Jul 31, 2024

Fixes #1861

Summary by Sourcery

This pull request addresses an issue with non-contiguous arrays in transformations, ensuring that output arrays are always contiguous. It includes refactoring of transformation functions and tests, as well as updates to build dependencies.

  • Bug Fixes:
    • Fixed issue with non-contiguous arrays in transformations to ensure output arrays are always contiguous.
  • Enhancements:
    • Refactored transformation functions to remove unnecessary calls to np.ascontiguousarray.
    • Updated parameterization in tests to use new helper functions for generating transformation parameters.
  • Build:
    • Updated pyproject-fmt pre-commit hook to version 2.2.0.
    • Updated albucore dependency to version 0.0.13 in setup.py.
  • Tests:
    • Added new tests to verify that transformations produce contiguous output arrays.
    • Refactored existing tests to use new helper functions for generating transformation parameters.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jul 31, 2024

Reviewer's Guide by Sourcery

This pull request addresses issue #1861 by removing unnecessary contiguous array enforcement in the albumentations library. It updates several functions and methods to ensure arrays are contiguous only when necessary. Additionally, it updates and adds tests to verify that transformations produce contiguous arrays. The pre-commit hook and albucore dependency versions have also been updated.

File-Level Changes

Files Changes
albumentations/core/composition.py
albumentations/core/transforms_interface.py
albumentations/augmentations/geometric/functional.py
albumentations/augmentations/transforms.py
albumentations/augmentations/functional.py
Removed contiguous array enforcement and decorators, ensuring arrays are contiguous only when necessary.
tests/test_core.py
tests/test_augmentations.py
Updated and added tests to ensure transformations produce contiguous arrays.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @ternaus - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟡 Testing: 2 issues found
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@ternaus ternaus merged commit bcaf7d6 into main Jul 31, 2024
@ternaus ternaus deleted the fix_contigous branch July 31, 2024 14:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

2 participants