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

Expand patch radius if input is int #2372

Merged
merged 3 commits into from Apr 22, 2021
Merged

Conversation

FelixLiu-SF
Copy link
Contributor

if patch radius is an int, it needs to be expanded to (1,3) array before calling _extract_3d_patches.

if patch radius is an int, it needs to be expanded to (1,3) array before calling _extract_3d_patches.
@pep8speaks
Copy link

pep8speaks commented Apr 20, 2021

Hello @FelixLiu-SF, Thank you for updating !

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated at 2021-04-21 20:47:26 UTC

Copy link
Member

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

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

Hi @FelixLiu-SF,

Thank you for doing this fix!

@ShreyasFadnavis, Can you look into this PR? Thank you

@skoudoro skoudoro added this to the 1.4.1 milestone Apr 20, 2021
Copy link
Member

@ShreyasFadnavis ShreyasFadnavis left a comment

Choose a reason for hiding this comment

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

Hi @FelixLiu-SF - Good catch! And thank you for this PR 👍🏽

1 minor comment from me, otherwise I think the PR looks good!

@skoudoro I don't think there is a unit test for this functionality.

dipy/denoise/patch2self.py Show resolved Hide resolved
@ShreyasFadnavis
Copy link
Member

Maybe hard to unit-test this since it's not a function of its own. We can make a function for it if necessary!

@skoudoro
Copy link
Member

skoudoro commented Apr 20, 2021

Maybe hard to unit-test this since it's not a function of its own. We can make a function for it if necessary!

In your unit tests, you call many times patch2selfwith the default patch_radius. You just need to pick one of them and add patch_radius=0 instead of [0, 0, 0]. It should be enough, we should get the same result and the int is tested

@ShreyasFadnavis
Copy link
Member

Maybe hard to unit-test this since it's not a function of its own. We can make a function for it if necessary!

In your unit tests, you call many times patch2selfwith the default patch_radius. You just need to pick one of them and add patch_radius=0 instead of [0, 0, 0]. It should be enough, we should get the same result and the int is tested

Yep -- Good idea! Works :)

Remove whitespace in empty line
Copy link
Member

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

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

Hi @FelixLiu-SF,

Thank you for your pep8 fix. Can you update a test and then your PR will be ready to be merged.

You just need to update this line and add patch_radius=0 as a parameter.

Thank you.

@codecov
Copy link

codecov bot commented Apr 21, 2021

Codecov Report

Merging #2372 (f6089b5) into master (e96c440) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2372      +/-   ##
==========================================
- Coverage   85.25%   85.24%   -0.01%     
==========================================
  Files         125      125              
  Lines       16556    16558       +2     
  Branches     2683     2684       +1     
==========================================
+ Hits        14114    14115       +1     
  Misses       1759     1759              
- Partials      683      684       +1     
Impacted Files Coverage Δ
dipy/denoise/patch2self.py 73.63% <100.00%> (+0.48%) ⬆️
dipy/reconst/forecast.py 89.84% <0.00%> (-0.51%) ⬇️

@FelixLiu-SF
Copy link
Contributor Author

Hi @FelixLiu-SF,

Thank you for your pep8 fix. Can you update a test and then your PR will be ready to be merged.

You just need to update this line and add patch_radius=0 as a parameter.

Thank you.

All set!

@ShreyasFadnavis
Copy link
Member

Thanks for this @FelixLiu-SF ! I think its ready to be merged 👍🏽

I will wait till tomorrow if anyone else has any other comments.
Thanks for the review @skoudoro!

@ShreyasFadnavis
Copy link
Member

Okay! This is good to go! Merging 🚀

Thanks @FelixLiu-SF !

@ShreyasFadnavis ShreyasFadnavis merged commit 8fcd1af into dipy:master Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants