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

RF: Migrate duplicated rois2masks code to function in roitools #187

Merged
merged 3 commits into from Jun 26, 2021

Conversation

scottclowe
Copy link
Member

Following good software development practice, DRY: Don't repeat yourself, this replicated code should be refactored into a common function.

The only thing which differs is how the image shape is determined, and so I have introduced a function which produces that output and sends it to roitools.rois2masks. We are still using DataHandler.rois2masks. For the builtin DataHandler classes, this trivially points to roitools.rois2masks(rois, self.get_image_size(data), but others could make "masks" be non-masks if they would like to have a different interface outside of roitools like @swkeemink was saying in #100.

@codecov
Copy link

codecov bot commented Jun 18, 2021

Codecov Report

Merging #187 (f0cd6f7) into master (e4972a9) will decrease coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #187      +/-   ##
==========================================
- Coverage   93.06%   93.00%   -0.07%     
==========================================
  Files           8        8              
  Lines         909      900       -9     
  Branches      188      180       -8     
==========================================
- Hits          846      837       -9     
  Misses         32       32              
  Partials       31       31              
Flag Coverage Δ
nbsmoke 65.44% <72.00%> (+1.41%) ⬆️
unittests 92.88% <100.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
fissa/extraction.py 95.04% <100.00%> (-0.83%) ⬇️
fissa/roitools.py 90.22% <100.00%> (+1.24%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4972a9...f0cd6f7. Read the comment docs.

@scottclowe scottclowe merged commit 7a4dcf5 into rochefort-lab:master Jun 26, 2021
@scottclowe scottclowe deleted the rf_rois2masks branch June 26, 2021 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant