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 example to FundamentalMatrixTransform class #6863

Merged
merged 9 commits into from
Dec 15, 2023

Conversation

ana42742
Copy link
Contributor

Description

Addresses a task in #6808.
I have added an example to the FundamentalMatrixTransform Class in skimage.transform module.
This comprehensive example demonstrates its three methods, estimate, residuals and
inverse as well.

Resolves a task in

Checklist

  • Docstrings for all functions
  • Gallery example in ./doc/examples (new features only)
  • Benchmark in ./benchmarks, if your changes aren't covered by an
    existing benchmark
  • Unit tests
  • 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.

@lagru lagru added 📄 type: Documentation Updates, fixes and additions to documentation 👋 Outreachy labels Apr 6, 2023
Copy link
Member

@lagru lagru left a comment

Choose a reason for hiding this comment

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

I left a small suggestion but looks good otherwise. If you want you could also add some brief descriptions to separate the logical parts of the example like in bc6baeb.

skimage/transform/_geometric.py Outdated Show resolved Hide resolved
@ana42742
Copy link
Contributor Author

ana42742 commented Apr 9, 2023

@lagru I have incorporated your suggestions.

Comment on lines +263 to +264
>>> import skimage as ski
>>> tform_matrix = ski.transform.FundamentalMatrixTransform()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
>>> import skimage as ski
>>> tform_matrix = ski.transform.FundamentalMatrixTransform()
>>> tform_matrix = FundamentalMatrixTransform()

(iirc this explicit import is unnecessary)

Copy link
Member

@lagru lagru Dec 7, 2023

Choose a reason for hiding this comment

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

While it's not necessary for the tests to pass I think complete imports should be part of each doctests. That makes them easier to copy and also more explicit in a few ways. Also I recall that in some edge cases doctest gets confused if functions or classes share a name of a submodule. Using ski.module.some_object avoids this.

It's also more consistent since we have to include import skimage as ski in doctests that uses API from other modules.

Copy link
Member

Choose a reason for hiding this comment

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

@lagru ok, I get your rationale; I agree it's more robust and more extensible to include import skimage as ski in all doctests. Taking note.

@ana42742 please revert my suggestion; sorry for the noise!

Co-authored-by: Marianne Corvellec <[email protected]>

This comment was marked as outdated.

@github-actions github-actions bot added the 😴 Dormant No recent activity label Dec 5, 2023
@github-actions github-actions bot removed the 😴 Dormant No recent activity label Dec 7, 2023
Copy link
Member

@lagru lagru left a comment

Choose a reason for hiding this comment

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

Approving since this already is a great improvement. Though personally, I'd prefer for #6863 (comment) / 85d7910 to be reverted.

@lagru
Copy link
Member

lagru commented Dec 7, 2023

@ana42742, I am curious. Do you remember where you got the numbers from?

@mkcor
Copy link
Member

mkcor commented Dec 9, 2023

I'm also in favour of reverting #6863 (comment) / 85d7910. As per #7020 (comment), I'll wait until Dec 14. If we don't hear from @ana42742 until then, I'll make the change and approve the PR.

@lagru lagru assigned lagru and unassigned lagru Dec 9, 2023
@mkcor mkcor merged commit 09577ed into scikit-image:main Dec 15, 2023
22 checks passed
@stefanv stefanv added this to the 0.23 milestone Dec 15, 2023
@lagru lagru mentioned this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📄 type: Documentation Updates, fixes and additions to documentation 👋 Outreachy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants