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

small speedboost by precalculating conjugation #165

Merged
merged 15 commits into from
May 8, 2024

Conversation

McHaillet
Copy link
Collaborator

@McHaillet McHaillet commented May 3, 2024

PR to improve the speed a bit more and setup a few things to allow easier implementation of phase randomization.

Conjugated rft's of the tomogram are precalculated (instead of template conjugation). This requires some different shifting of the output score map and a different mask for calculating the score map standard deviation (hence some changes there).

Results are consistent with previous implementation and all the tests pass.

also closes #103

Copy link

github-actions bot commented May 3, 2024

File Coverage Missing
All files 81%
src/pytom_tm/angles.py 94% 44
src/pytom_tm/correlation.py 85% 94-95 126
src/pytom_tm/entry_points.py 70% 27 104-121 290-350 439-454 551-566 815-883 924-935
src/pytom_tm/extract.py 73% 107-118 170-176 202-205 277-295
src/pytom_tm/io.py 48% 15-19 25-28 34-37 43-46 52-55 62-66 74-87 93-100 107-114 129-131 184 218-219 261-263 279 295 312-321 341-346
src/pytom_tm/mask.py 80% 70 85 94-95
src/pytom_tm/parallel.py 84% 14-15 81-87 95-97 104 109 148
src/pytom_tm/plotting.py 16% 20-22 25-32 36-44 48-51 54-70 73-74 77-78 98-103 119-127 133-150 165-173 177-194 198-206 210-217 223 229 234 248-398
src/pytom_tm/template.py 57% 57-58 67 76-87 92-97 107-112 114
src/pytom_tm/tmjob.py 96% 177-178 190 196-198 201 334 374
src/pytom_tm/utils.py 78% 16-18
src/pytom_tm/weights.py 96% 61 292-293 300 480 483 486

Minimum allowed coverage is 79%

Generated by 🐒 cobertura-action against 7b61153

@McHaillet McHaillet requested a review from sroet May 3, 2024 19:07
Copy link
Collaborator

@sroet sroet left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me, couple points:

  1. one surprise with performance
  2. this breaks API so should invoke version 0.7.0 instead of the current next release of 0.6.0
  3. One line was changed that was not covered in our current tests, please add a test to cover that line 😄

src/pytom_tm/matching.py Show resolved Hide resolved
src/pytom_tm/matching.py Outdated Show resolved Hide resolved
src/pytom_tm/matching.py Show resolved Hide resolved
@McHaillet McHaillet requested a review from sroet May 7, 2024 16:44
Copy link
Collaborator

@sroet sroet left a comment

Choose a reason for hiding this comment

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

still 1 missing test, LGTM otherwise

src/pytom_tm/matching.py Show resolved Hide resolved
@McHaillet
Copy link
Collaborator Author

Woops this didn't fix it yet

@McHaillet
Copy link
Collaborator Author

McHaillet commented May 7, 2024

I set precision to 4 for the standard deviation. interpolation of the spherical mask upon rotation slightly changes the mask, meaning the eventual scores won't be identical. It should still be very close and that is indeed true.

@McHaillet
Copy link
Collaborator Author

McHaillet commented May 7, 2024

Its fixed now. The lines are hit!
Also upping the coverage to 80

@McHaillet McHaillet requested a review from sroet May 7, 2024 17:20
@McHaillet
Copy link
Collaborator Author

Needed to merge changes from main to make it mergeable. Lets see if they now pass.

Copy link
Collaborator

@sroet sroet left a comment

Choose a reason for hiding this comment

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

LGTM, feel free to merge on green

@McHaillet McHaillet merged commit 8404e74 into SBC-Utrecht:main May 8, 2024
2 checks passed
@McHaillet McHaillet deleted the speed_boost branch May 8, 2024 08:50
@sroet sroet mentioned this pull request May 8, 2024
9 tasks
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.

unnecessay recalculation of rfft of mask in mean_under_mask_convolution
2 participants