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

PiecewiseAffineTransform.estimate return should reflect underlying transforms #6211

Merged

Conversation

chrisroat
Copy link
Contributor

Description

Prior to this change, PiecewiseAffineTransform.estimate always returns True -- even when one of the underlying transforms is ill-conditioned. This change causes a return value of True only when all the transforms are well-conditioned.

Closes #6206

Checklist

  • Unit test updated
  • Clean style in the spirit of PEP8
  • Descriptive commit messages (see below)

For reviewers

  • Check that the PR title is short, concise, and will make sense 1 year
    later.
  • Check that new functions are imported in corresponding __init__.py.
  • Check that new features, API changes, and deprecations are mentioned in
    doc/release/release_dev.rst.
  • There is a bot to help automate backporting a PR to an older branch. For
    example, to backport to v0.19.x after merging, add the following in a PR
    comment: @meeseeksdev backport to v0.19.x
  • To run benchmarks on a PR, add the run-benchmark label. To rerun, the label
    can be removed and then added again. The benchmark output can be checked in
    the "Actions" tab.

Copy link
Contributor

@grlee77 grlee77 left a comment

Choose a reason for hiding this comment

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

This fix looks sensible to me. Thanks @chrisroat (will merge in a couple days if there are no further comments)

Copy link
Member

@rfezzani rfezzani left a comment

Choose a reason for hiding this comment

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

Thank you @chrisroat, I simply suggest to rename the ok variable to success to match the docstring, otherwise it LGTM 😉

skimage/transform/_geometric.py Outdated Show resolved Hide resolved
skimage/transform/_geometric.py Outdated Show resolved Hide resolved
skimage/transform/_geometric.py Outdated Show resolved Hide resolved
skimage/transform/_geometric.py Outdated Show resolved Hide resolved
Co-authored-by: Riadh Fezzani <rfezzani@gmail.com>
@alexdesiqueira alexdesiqueira merged commit 589fd8b into scikit-image:main Jan 27, 2022
@alexdesiqueira
Copy link
Member

Thank you @chrisroat!

@grlee77
Copy link
Contributor

grlee77 commented Feb 14, 2022

@meeseeksdev backport to v0.19.x

meeseeksmachine pushed a commit to meeseeksmachine/scikit-image that referenced this pull request Feb 14, 2022
grlee77 added a commit that referenced this pull request Feb 15, 2022
…1-on-v0.19.x

Backport PR #6211 on branch v0.19.x (PiecewiseAffineTransform.estimate return should reflect underlying transforms)
tibuch pushed a commit to fmi-faim/scikit-image that referenced this pull request Mar 14, 2022
…ansforms (scikit-image#6211)

* PiecewiseAffineTransform.estimate return should reflect underlying transforms

Co-authored-by: Riadh Fezzani <rfezzani@gmail.com>
rapids-bot bot pushed a commit to rapidsai/cucim that referenced this pull request Mar 25, 2022
)

Closes #199

Corresponds to:
scikit-image/scikit-image#6207
scikit-image/scikit-image#6211
scikit-image/scikit-image#6214

Additionally, the affines contained within the `PiecewiseAffineTransform` will have parameters in CuPy arrays when the inputs to `estimate` are CuPy arrays. This is one to make it consistent with the other transform classes.

@chrisroat, can you confirm if this fixes the issue for you?

Authors:
  - Gregory Lee (https://github.com/grlee77)

Approvers:
  - https://github.com/jakirkham

URL: #208
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🩹 type: Bug fix Fixes unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Propagate AffineTransform estimate return value in PiecewiseAffineTransform
4 participants