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

Deleted update_params #2267

Merged
merged 1 commit into from
Jan 8, 2025
Merged

Deleted update_params #2267

merged 1 commit into from
Jan 8, 2025

Conversation

ternaus
Copy link
Collaborator

@ternaus ternaus commented Jan 8, 2025

Summary by Sourcery

Renamed update_params_shape to update_transform_params and updated its docstring to reflect that it now updates parameters with both input shape and transform-specific parameters. Removed the deprecated update_params method and the var_limit and mean parameters from GaussNoise.

Enhancements:

  • Updated update_transform_params to include transform-specific parameters like interpolation, fill, and fill_mask.

Tests:

  • Updated tests to use update_transform_params instead of update_params_shape.

Copy link
Contributor

sourcery-ai bot commented Jan 8, 2025

Reviewer's Guide by Sourcery

This PR refactors the update_params method into two separate methods: update_transform_params and get_params. It also removes the deprecated var_limit and mean parameters from the GaussNoise class.

Sequence diagram for updated parameter handling flow

sequenceDiagram
    participant T as Transform
    participant P as Parameters

    T->>T: __call__()
    alt should_apply is true
        T->>T: get_params()
        T->>T: update_transform_params(params, data)
        Note over T: Updates shape and transform-specific params
        T->>T: apply_with_params(params)
        T->>P: Apply transformation with updated params
    end
Loading

Class diagram showing transform parameter handling changes

classDiagram
    class Transform {
        +__call__(*args, force_apply, **kwargs)
        +get_params()
        +update_transform_params(params, data)
        +apply_with_params(params, *args, **kwargs)
        -should_apply(force_apply)
    }

    class GaussNoise {
        +mean_range: tuple
        +per_channel: bool
        +noise_scale_factor: float
    }

    GaussNoise --|> Transform

    note for Transform "Removed deprecated update_params method
Merged functionality into update_transform_params"
    note for GaussNoise "Removed deprecated var_limit and mean parameters"
Loading

File-Level Changes

Change Details Files
Replaced the deprecated update_params method with update_transform_params and get_params.
  • Renamed update_params_shape to update_transform_params.
  • Added transform-specific parameters to update_transform_params.
  • Removed the deprecated update_params method.
  • Updated the call to update_transform_params in the __call__ method.
  • Modified update_transform_params to include transform-specific parameters like interpolation, fill, and fill_mask
albumentations/core/transforms_interface.py
Removed deprecated parameters from GaussNoise.
  • Removed the var_limit and mean parameters from the GaussNoise class.
  • Updated tests to reflect the removal of the deprecated parameters.
albumentations/augmentations/transforms.py
tests/test_transforms.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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: all looks good
  • 🟢 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 and I'll use the feedback to improve your reviews.

@ternaus ternaus merged commit 669b60f into main Jan 8, 2025
14 checks passed
@ternaus ternaus deleted the cleanup branch January 8, 2025 02:28
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.

1 participant