sleap
sleap copied to clipboard
Move `process_batch` to an overridable method
Description
Previously, process_batch was a local function of the Predictor._predict_generator method. What if a certain predictor wants to process_batch a little differently?
This PR moves the process_batch function to an attribute of Predictor, allowing it to be overridden by any Predictor subclasses.
Types of changes
- [ ] Bugfix
- [ ] New feature
- [ ] Refactor / Code style update (no logical changes)
- [ ] Build / CI changes
- [ ] Documentation Update
- [x] Other (flexibility)
Does this address any currently open issues?
[list open issues here]
Outside contributors checklist
- [ ] Review the guidelines for contributing to this repository
- [ ] Read and sign the CLA and add yourself to the authors list
- [ ] Make sure you are making a pull request against the develop branch (not main). Also you should start your branch off develop
- [ ] Add tests that prove your fix is effective or that your feature works
- [ ] Add necessary documentation (if appropriate)
Thank you for contributing to SLEAP!
:heart:
Codecov Report
Merging #1525 (98e77c7) into develop (ed77b49) will decrease coverage by
0.01%. The diff coverage is93.33%.
@@ Coverage Diff @@
## develop #1525 +/- ##
===========================================
- Coverage 73.39% 73.39% -0.01%
===========================================
Files 134 134
Lines 23961 23961
===========================================
- Hits 17586 17585 -1
- Misses 6375 6376 +1
| Files | Coverage Δ | |
|---|---|---|
| sleap/nn/inference.py | 81.25% <93.33%> (ø) |
... and 1 file with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more