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

Add get_params_dependent_on_data method to transform interface. #1847

Merged
merged 4 commits into from
Jul 22, 2024

Conversation

ayasyrev
Copy link
Contributor

@ayasyrev ayasyrev commented Jul 19, 2024

Add get_params_dependent_on_data method to transform interface.
It need to substitute get_params_dependent_on_targets, simplify code.
This is not braking changes, proposes for discuss.

Summary by Sourcery

This pull request introduces a new method get_params_dependent_on_data to the transform interface, deprecating the older get_params_dependent_on_targets method. It also includes enhancements to the parameter update process and refactors the code to improve clarity and maintainability.

  • New Features:
    • Introduced get_params_dependent_on_data method to the transform interface for handling parameters dependent on input data.
  • Enhancements:
    • Deprecated get_params_dependent_on_targets method in favor of the new get_params_dependent_on_data method.
    • Updated update_params method to include a deprecation notice and guidance on using get_params and update_params_shape for specific parameters.
    • Refactored code to use update_params_shape for updating parameters with input image shape.

Copy link
Contributor

sourcery-ai bot commented Jul 19, 2024

Reviewer's Guide by Sourcery

This pull request introduces a new method get_params_dependent_on_data to the transform interface, replacing the deprecated get_params_dependent_on_targets. The changes include adding helper methods like update_params_shape and updating existing methods to use the new approach. These changes aim to simplify the code and improve parameter handling without breaking existing functionality.

File-Level Changes

Files Changes
albumentations/core/transforms_interface.py
albumentations/augmentations/domain_adaptation.py
albumentations/augmentations/mixing/transforms.py
Replaced get_params_dependent_on_targets with get_params_dependent_on_data across multiple files and updated methods to use new parameters.

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: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 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/core/transforms_interface.py Show resolved Hide resolved
@ternaus ternaus merged commit 3fe2d36 into albumentations-team:main Jul 22, 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