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

fix tests for FromFloat #1818

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

ayasyrev
Copy link
Contributor

@ayasyrev ayasyrev commented Jun 25, 2024

FromFloat need input array in the range [0, 1.0].
Fix tests with int input array.

Summary by Sourcery

This pull request fixes the tests for the FromFloat augmentation by ensuring that input arrays are in the range [0, 1.0] as required. The changes involve updating the test cases to use the correct input data type.

  • Bug Fixes:
    • Fixed tests for FromFloat to use input arrays in the range [0, 1.0] instead of integer arrays.

Copy link
Contributor

sourcery-ai bot commented Jun 25, 2024

Reviewer's Guide by Sourcery

This pull request fixes the tests for the FromFloat augmentation by ensuring that the input array is in the range [0, 1.0]. The changes include fixing indentation issues, removing redundant parameterizations, and adding conditional assignments for the image variable based on the augmentation class in multiple test functions.

File-Level Changes

Files Changes
tests/test_serialization.py
tests/test_transforms.py
tests/test_augmentations.py
Added conditional assignment for image based on augmentation_cls in multiple test functions to handle A.FromFloat.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • 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 @ayasyrev - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟡 Testing: 5 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.

tests/test_serialization.py Show resolved Hide resolved
tests/test_transforms.py Show resolved Hide resolved
tests/test_transforms.py Show resolved Hide resolved
tests/test_augmentations.py Show resolved Hide resolved
tests/test_augmentations.py Show resolved Hide resolved
@ternaus ternaus merged commit 8ee783a into albumentations-team:main Jun 25, 2024
17 checks passed
@ayasyrev ayasyrev deleted the fix_tests_fromfloat branch July 9, 2024 10:31
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

2 participants