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

Added docstring to skimage.registration submodule. #6791

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mahamtariq58
Copy link
Contributor

Description

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.

Comment on lines 1 to 2
"""Image registration module.
"""
Copy link
Member

Choose a reason for hiding this comment

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

Looks good, thank you for staring on this! :) What do you think about including a more verbose description on what functions in this module might be used for and what "image registration" is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would look much better. I will surely add the suggested changes to my PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think i have messed up something while commiting.. Should i make another branch and create a new pull request?

Copy link
Member

Choose a reason for hiding this comment

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

That's not a problem. A good opportunity to learn some git. 💪

I'm not sure how your local branch looks but the state of mahamtariq58:docstring-to-skimage.registration doesn't look that messed up. It's just a whitespace change that I actually agree with. 😄

You could just try to add the changes in 0a3d56e back to the module and create a new commit. When we merge, we usually squash all these different commits into a single commit.

In case your local branch doesn't reflect the remote state, you should be able to force the remote state with

git fetch --all
git reset --hard origin/docstring-to-skimage.registration

Let me know if that helps.

@lagru lagru added the 📄 type: Documentation Updates, fixes and additions to documentation label Mar 8, 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.

Nice, @mahamtariq58, I think you managed to fix the commit history. 🎉 I left a few more comments regarding the docstring itself. Please, ask if something is unclear or you don't agree with the suggestion. :)

Comment on lines +6 to +15
Functions
---------
phase_cross_correlation: function
Perform the phase correlation to determine the shift between two images using DFT upsampling.

optical_flow_tvl1: function
Estimates the optical flow components for each axis between two images using TV-L1 solver.

optical_flow_ilk: function
Estimates the optical flow between two images using iterative Lucas-Kanade(iLK) solver.
Copy link
Member

Choose a reason for hiding this comment

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

No need to list these functions in the docstring. In our HTML documentation, the docstring is followed by an automatically generated list. And IDEs usually make these contents discover-able through autocompletion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now I get it where did I go wrong regarding the commits. Hopefully not to repeat them next time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, do I need to add just the general purpose of these functions in the extended summary?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, it would be good to help users who are discovering this module and are asking themselves "okay, restoration, what is it, why is it useful, and what is it used for".

"""
Image registration module

This module provides a set of functions to register (align two images into single coordinate system) based on various transformation models. Implemented algorithms include phase_cross_correlation and optical flow estimator.
Copy link
Member

Choose a reason for hiding this comment

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

Could you wrap this to a max line length of 88?

Comment on lines +17 to +33
See Also
--------
See the documentation for each function for details.

Notes
-----
Color images are not supported for optical flow estimators.

Examples
--------
>>> from skimage import data
>>> from skimage.data import stereo_motorcycle
>>> from skimage.registration import optical_flow_tvl1
>>> image0, image1, disp =stereo_motorcycle()
>>> image0=rgb2gray(image0)
>>> image1=rgb2gray(image1)
>>> flow= optical_flow_tvl1(image1,image0)
Copy link
Member

Choose a reason for hiding this comment

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

I'm sorry to say this, but I also think that these sections don't provide much value or state things that are better placed in their respective docstrings.

Comment on lines +1 to +2
"""
Image registration module
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can make this line describe what image registration is? What do you think about

Suggested change
"""
Image registration module
"""Utilities to relate different sets of data in one coordinate system.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would seem much better.

@github-actions
Copy link

Hey, there hasn't been any activity on this pull request for more than 180 days. For now, we have marked it as "dormant" until there is some new activity. You are welcome to reach out to people by mentioning them here or on our forum if you need more feedback! Otherwise, we would be thankful for a short update, for example if you would like to continue or if you are okay with someone else doing so. In any case, thank you for your contributions so far!

@github-actions github-actions bot added the 😴 Dormant no recent activity label Sep 24, 2023
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 😴 Dormant no recent activity 👋 Outreachy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants