funkelab / gunpowder

A library to facilitate machine learning on multi-dimensional images.
https://funkelab.github.io/gunpowder/
MIT License
78 stars 56 forks source link

Move `BathProvider.__add__` #179

Closed tlambert03 closed 2 years ago

tlambert03 commented 2 years ago

This PR puts the __add__ and __radd__ methods directly on BatchProvider, rather than dynamically monkeypatching it when pipeline.py is imported. This makes it easier to inspect, and appeases type checkers that yell at you when you try to add a tuple of Source objects to a BatchProvider:

Screen Shot 2022-09-07 at 7 23 36 PM

Pre-Merge Checklist:

note: i branched off of master ... which seems to be the cause for the change in setup.py (when merging into patch-1.2.3) ... let me know if I should be merging to something else.

also, couldn't run all tests locally on mac due to the subprocess issue that I think @pattonw was fixing at dl@mbl ... and it doesn't look like the travis tests are running here?