torchio
torchio copied to clipboard
Add support to pass a callable as padding mode
Fixes #957.
Description
It fixes the KeyError message when a function is passed as padding_mode in the Pad class.
Checklist
- [x] I have read the
CONTRIBUTINGdocs and have a developer setup (especially important arepre-commitandpytest) - [x] Non-breaking change (would not break existing functionality)
- [ ] Breaking change (would cause existing functionality to change)
- [x] Tests added or modified to cover the changes
- [x] Integration tests passed locally by running
pytest - [ ] In-line docstrings updated
- [ ] Documentation updated, tested running
make htmlinside thedocs/folder - [x] This pull request is ready to be reviewed
- [ ] If the PR is ready and there are multiple commits, I have squashed them and force-pushed
Codecov Report
Merging #959 (1539c1c) into main (6338270) will increase coverage by
0.03%. The diff coverage is100.00%.
@@ Coverage Diff @@
## main #959 +/- ##
==========================================
+ Coverage 86.19% 86.22% +0.03%
==========================================
Files 92 92
Lines 5801 5802 +1
==========================================
+ Hits 5000 5003 +3
+ Misses 801 799 -2
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...rc/torchio/transforms/preprocessing/spatial/pad.py | 95.34% <100.00%> (+4.87%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Thanks for your contribution, @mueller-franzes!
@all-contributors please add @mueller-franzes for code
@fepegar
I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.
I've put up a pull request to add @mueller-franzes! :tada: