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

Remove get_params_dependent_on_targets #1857

Merged

Conversation

ayasyrev
Copy link
Contributor

@ayasyrev ayasyrev commented Jul 25, 2024

Change get_params_dependent_on_targets to get_params_dependent_on_data
Now only Equalize uses it.

Summary by Sourcery

This pull request refactors the method get_params_dependent_on_targets to get_params_dependent_on_data across various augmentation and transformation classes. It also updates the parameter handling to use params['shape'] instead of params['image'] for improved generalization.

  • Enhancements:
    • Renamed get_params_dependent_on_targets to get_params_dependent_on_data across multiple files for consistency and clarity.
    • Replaced usage of params['image'] with params['shape'] to generalize parameter handling and improve flexibility.

Copy link
Contributor

sourcery-ai bot commented Jul 25, 2024

Reviewer's Guide by Sourcery

This pull request refactors the method get_params_dependent_on_targets to get_params_dependent_on_data across multiple files. The changes involve updating method signatures and internal logic to use a more generalized 'data' parameter instead of 'targets'. Additionally, the targets_as_params property has been removed from several classes.

File-Level Changes

Files Changes
albumentations/augmentations/transforms.py
albumentations/augmentations/crops/transforms.py
albumentations/augmentations/geometric/transforms.py
albumentations/augmentations/dropout/xy_masking.py
albumentations/augmentations/dropout/channel_dropout.py
albumentations/augmentations/blur/transforms.py
albumentations/augmentations/dropout/coarse_dropout.py
albumentations/augmentations/dropout/grid_dropout.py
albumentations/augmentations/geometric/rotate.py
albumentations/augmentations/dropout/mask_dropout.py
Renamed get_params_dependent_on_targets to get_params_dependent_on_data, updated method signatures to include data parameter, replaced params["image"] with params["shape"] or data["image"], and removed targets_as_params property.
tests/test_transforms.py Updated test cases to use get_params_dependent_on_data instead of get_params_dependent_on_targets, and modified test parameters to include data and params.

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 @ayasyrev - I've reviewed your changes and they look great!

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

albumentations/augmentations/transforms.py Show resolved Hide resolved
tests/test_transforms.py Show resolved Hide resolved
albumentations/augmentations/transforms.py Outdated Show resolved Hide resolved
albumentations/augmentations/transforms.py Outdated Show resolved Hide resolved
albumentations/augmentations/dropout/channel_dropout.py Outdated Show resolved Hide resolved
albumentations/augmentations/transforms.py Outdated Show resolved Hide resolved
@ayasyrev
Copy link
Contributor Author

please rerun actions.

@ternaus ternaus merged commit 2af5cde into albumentations-team:main Jul 26, 2024
17 checks passed
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.

2 participants